Do yourself a favor and stop doing those challenges.
All what you learn is that you are unable to complete them fast enough.
To compete on those challenges, you need to learn advanced algorithms (and understand them), and it is not just a few, there are tens of them, and you need to learn the art of combining them to get an optimum solution.
As you learn algorithms, you will see that you also need to master data structures.
All those fit in books and there is no way we can teach them to you in the frame of this forum.
Quote:
I have tried with many things but its giving me TLE ans its complexity is not good
You have shown us nothing of your work, you did not even asked a question.