about | help | code help+videos | done | prefs |
Write a method that returns the sum of the digits of every other digit in the number starting with the ones place, then skipping to the hundreds place (if present), then skipping to the ten-thousands place (if present), and so on. Your solution MUST be recursive and MUST be generalized (meaning you cannot use a whole bunch of conditional special-cases). As a precondition, the input parameter must be non-negative. poolRAltDigSum(3) → 3 poolRAltDigSum(1) → 1 poolRAltDigSum(0) → 0 ...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: 330
Copyright Nick Parlante 2017 - privacy