about | help | code help+videos | done | prefs |
Write a method that determines the "flurb" of a positive integer. The "flurb" is always a single-digit. To find the flurb of a number, add the digits of the number in a funny and call this the "funny sum" as described below: Each digit is worth its numeric value times its place in the number. For example, in the number 472, the 4 is in the 3rd place, the 7 in the 2nd place, and the 2 is in the 1st place. So the "funny sum" of 472 is 4*3 + 7*2 + 2*1 = 12 + 14 + 2 = 28. When calculating the flurb of a number, you continue to "flurberize" the "funny sum" until you get a single-digit number. For example, flurb(472)=flurb(28)=flurb(12)=flurb(4) and the flurb of a single-digit number is just that number, so the flurb of 472 is 4. flurb(5) → 5 flurb(7) → 7 flurb(14) → 6 ...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