Google | OA | problem from HackerEarth
Anonymous User
898

The following is the problem. I solved it with quadratic time, but I have no idea how this can be solved within linear time.

image
image
image
image
image
image

Can someone give some explanation and the code?
Thank you

Comments (1)