it shows tle in one test case
@naazsayma123 refer to this o(n) solution
@aa1 i did the same can you tell me whats wrong in my code