about | help | code help+videos | done | prefs |
semiProduct
Let's define the "semiproduct" of two positive integers to be the product of the sums of each of their digits. So the "semiproduct" of 21 and 71 is 24 because 2+1=3 and 7+1=8, then 3*8=24. Decompose out a separate digitSum(int n) method that finds the sum of the digits of a positive integer. semiProduct(18, 3) → 27 semiProduct(46, 73) → 100 semiProduct(12, 35) → 24 ...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: 325 Post-solution available
Copyright Nick Parlante 2017 - privacy