Given an input count
, increment the same by 1 and add it to itself. Continue the same till the count value reaches the maximum count. The function should return the final sum.
- The count should increment at least once irrespective of the maximum count.
- Do NOT use
do..while
or any other looping constructs. Use higher-order functions like map
, filter
, etc.
- Order matters: You need to first increment count, and then get the sum.