about | help | code help+videos | done | prefs |
Write a method that returns the sum of alternating digits in the non-negative input parameter, starting with the one's place. For example, the input 32915 will return 17 since 5+9+3=17. You are not allowed to use any string manipulation of any kind in solving this problem! Hint: Remember div and mod??? cedarAddAlternatingDigits(6) → 6 cedarAddAlternatingDigits(7) → 7 cedarAddAlternatingDigits(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: 290
Copyright Nick Parlante 2017 - privacy