about | help | code help+videos | done | prefs |
Write a method that accepts two integers 'a' and 'b' then returns the "funny sum" of those integers. The "funny sum" is a+b+(half b)+(half half b)+(half half half b)+... stopping before you get to 1. Note that (half b) refers to b div 2 and (half half b) refers to (b div 2) div 2. quizSLAPHL_P2(4291, 8) → 4305 quizSLAPHL_P2(28, 22) → 68 quizSLAPHL_P2(248, 2142) → 4525 ...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: 299
Copyright Nick Parlante 2017 - privacy