about | help | code help+videos | done | prefs |
Write a recursive method that returns the sum of each digit times 'mult'. For example, if 'num'=307 and 'mult'=4, the result would be equivalent to 3*4+0*4+7*4=12+0+28=40 so 40 would be returned. However, you MUST solve it recursively! feb27_2018_HL_recursiveDigitSum(45, 1) → 9 feb27_2018_HL_recursiveDigitSum(1300702, 1) → 13 feb27_2018_HL_recursiveDigitSum(1507, 6) → 78 ...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: 410
Copyright Nick Parlante 2017 - privacy