about | help | code help+videos | done | prefs |
Write a method that accepts two numbers, 'num' and 'ofst'. Return the product of all the digits in 'num' but with each digit offset by 'ofst' amount. For example, if you pass in 523,-1 the result would be 8 because 4*1*2=8. So each digit is offset by -1 making the 5 a 4, the 2 a 1, and the 3 a 2, then the product of all those values is found. This CAN be done nicely with recursion, but recursion is NOT required. may12_2017_APSLHL_digProdOffSet(5, 0) → 5 may12_2017_APSLHL_digProdOffSet(5, 2) → 7 may12_2017_APSLHL_digProdOffSet(3, 9) → 12 ...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