Output in the above code in the main method should be 301.5882352941176, though I get the output 242.5.
Type: Posts; User: keepStriving
Output in the above code in the main method should be 301.5882352941176, though I get the output 242.5.
It's hard to explain, it calculates the lifetime of candies, the input is the months of the year with values greater than zero if candy was eaten at end of month, so basically if candy was eaten only...
Well so many other people have got the problem right on TopCoder plus I assume the examples are most definitely correct.
TopCoder Statistics - Problem Statement
I'm tackling the above practice problem, my solution seems to work for example 0 and example 1, though not the last two. I've even tried working out...