about | help | code help+videos | done | prefs |
Let's define a "hyper-power" this way: a to the hyper-power of b means a to the b to the b to the b... a total of b times. For example, 2 to the hyper-power of 3 means ((2^3)^3)^3. 5 to the hyper-power of 4 means (((5^4)^4)^4)^4. Clearly these numbers can get very big very fast, so you will need to return your result as a 'long'. Look at the test data for examples. You may assume as a precondition that none of the results will be greater than the maximum 'long' and that num>=1 and power>=0. mar5_2020_SLHL_hyperPower(4, 0) → 1 mar5_2020_SLHL_hyperPower(17, 2) → 83521 mar5_2020_SLHL_hyperPower(1, 5) → 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: 290
Copyright Nick Parlante 2017 - privacy