Noob here, what's wrong with my code? (TLG)

Can anyone tell me what’s wrong with my solution to the problem

@ssjgz Might help you out :slight_smile:



It fails on the testcase:

17 33
26 60
34 32
27 22

(the answer should be

2 50


See my answer here.


Oh! i understood the question wrongly. I fixed it and now it works with your test case too but for some reason it is still not accepted.

1 Like

It seems to fail on the following testcase:

(the answer should be

2 435084

1 Like

Yeah it works now. Thanks! :+1: I changed all the short ints to ints. I should be more careful with these things.

1 Like

Why it should be 2 50 …?
maybe i misinterpreted the question

Its largest cumulative lead. You need to find the sum of scores till that point and find the max difference.

1 Like