Here is the code. Please help me find where I am going wrong.
Mike and HashTrick - TLE
N can be upto 1e5 and max(A[i]) can be upto 1e9. You are using nested loops O(n*n) hence it results in TLE. Don’t use same function given in problem instead try looking for underneath pattern.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.