Hi Everyone,
I am getting a wrong answer this problem. What is wrong in my solution.
Hi Everyone,
I am getting a wrong answer this problem. What is wrong in my solution.
Hey akshaypatade_1 ,
You are getting NZEC because in line number 67 you are storing (25000)*(25000) of data which is not possible as It will cause memory overflow , also your code has Time complexity of O(n^2) which is also the next error which will give TLE.
I suggest you to solve this problem in O(n+m) time using two pointer approach