• + 13 comments

    This problem and expected answers are bogus. To get true cost, you should be evaluating using floating point, but using floats gets you "incorrect" answers for #4 and #5. Switching about to using ints you get all test cases passing. So this problem is pretty misleading.