about | help | code help+videos | done | prefs |
Write a method that returns the number of times it takes to divide by successive integers using integer division, before you get a result of 0. You start by dividing 'num' by 2, then you divide that integer result by 3, then that result by 4, etc. Return the number of divisions of this type needed to get a result of 0. Look at the test data for examples. You MAY use recursion, but it is not required. If you do choose to use recursion, you should definitely use a helper method. test2024_09_19_SLHL_steps(80) → 4 test2024_09_19_SLHL_steps(2) → 2 test2024_09_19_SLHL_steps(3) → 2 ...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: 240
Copyright Nick Parlante 2017 - privacy