about | help | code help+videos | done | prefs |
blackHoleTwoDigit Write the method to receive a two digit number (where the digits are distinct.) and counts the number of repetitions needed to transform the given number sum of the two digits into the value 9. Make 2 two digit numbers and subtract the smaller number from the larger (example: Given 83 new number 38 - next subtract - difference is 45 repeat the process 45 and 54 (54-45=9) Conclusion the process required two subtractions and will (always) end with 9)(contributed problem by Harry Zhao.) blackHoleTwoDigit(90) → 5 blackHoleTwoDigit(89) → 1 blackHoleTwoDigit(87) → 1 ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 110
Copyright Nick Parlante 2017 - privacy