about | help | code help+videos | done | prefs |
This is based on the SLHL problem 'recursiveSumDigits'. You are allowed to copy and paste code from that problem into this one if it helps. Write a method that returns the "recursive sum of the digits" of all the integers from 'first' to 'last', inclusive. The results are returned in an array of integers with the index of that array indicating how far above 'first' you are. In other words, if 'first' is 50 and the index of an element in the array is 3, the number in that position in the array represents the recursiveSumDigits of 53 (which is 8). As preconditions, you may assume that 'first'>0 and 'last'>='first'. Look at the test data for examples. test2024_11_21_HL_recursiveSumDigitsFromTo(894, 895) → [3, 4] test2024_11_21_HL_recursiveSumDigitsFromTo(989352, 989354) → [9, 1, 2] test2024_11_21_HL_recursiveSumDigitsFromTo(1724, 1731) → [5, 6, 7, 8, 9, 1, 2, 3] ...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: 430
Copyright Nick Parlante 2017 - privacy