You are viewing a single comment's thread. Return to all comments →
Why is it that I get the wrong answer for test cases 11 and 12? do you get that as well?
You should consider the case where you get the maximum result.
Declare your sum variable as type long and solved.