Is learning DSA a humanly task? How can I learn it?

I feel so challenged to solve the algorithm problems. So far, I am only on time complexity analysis, and god, the amount of logic here it goes, it’s mind blowing.
How do I learn all of it to be able to solve all the GATE CSE level of problems? I can solve recurrence relations, but I always get confused in loops complexity. Can I ask difficult questions here?


for i<-1 to (n-1)
{
    for j<-i+1 to n
    {
        for k<-1 to j
        {
            print("*");
        }
    }
}

How many times will “star” be printed? In order of n?

I want to be able to solve more problems like that on my own without the help of anyone. Is practicing the only way to solve these problems? I mean that’d be like cheating?

I want to ask how to analyze these problems? Anyone who solved it at first attempt without google/chatgpt, what was your thought process like? Please explain your thought process

Hi @oslon - welcome! Practicing is key. Understanding why the code works the way it is also important. For example, here is a primer on how to understand the running time of an algorithm.

can you help to build thought process for this problems?