O(n^2) is getting accepted


#1

Please improve test cases so that brute force doesn’t pass.


#2

Totally agree. For this problem only Linear solution should be accepted.