One test case is not passing

https://ide.codingblocks.com/s/240429… if I am using (ans>=max_length) , then that case is passing but then others shows error … plz help

@dhirenkinha
Initialize right and left with -1, because the value of k may be zero so in that case we are not allowed do any modification. because if you initialize them with 0 then it will change it 0th element of the array.

1 Like