In past few days I have faced this problem very frequently. Implementing same Logic with set gives AC where as vector implementation gives TLE OR MLE.
I just changed the set implementation to set in order to check the running time.
Above is the example of MLE v/s AC.
If anyone could tell me what I am mising...
Thanks in Advance.