You are viewing a single comment's thread. Return to all comments →
I Don't know how. But without checking for array length, my code passed all tests. Following is what i did-
My logic is similar to yours. But I have declared everything as int. Large number inputs are failing in my case and i am pretty sure that my logic is correct. How can we handle large sums?
Thanks @Tomsaju :)
This approach really helped me passing the testcases #3 and #4 as i was getting timeout earlier.