DRANGE - wrong answer

Are there some corner cases that needs to be maintained?

My solution is getting WA and I do not know why. I have D array from tutorial in map. Numbers are increasing from index Ki to Ki-1. So I’m calculating values for these indexes and I maintain min and max, that’s all…

Btw: it’s not good, that same algorithm in Java is getting TLE :-/

In your solution you commented out the printf that spits out the answer!! I have just post it uncommented and it gives AC :).

1 Like

You can continue further discussion about this here. Closing this question as of now.

Thank you, so stupid :-/