one testcase wrong out of 3
Just use <= rather than < only as same numbers are also in a sorted manner.