How to solve any complex problem ?

How to solve any complex problem ?

Solve on a pen and paper. DO NOT start coding unless you are pretty clear with the logic of the problem.

Spend around 30–45 mins with every ques, not less not more.

Look into the solution/ editorial if you are not able to solve it. Let me tell you this, the challenge is not to solve on your own but to definitely solve it when you come across a similar problem for the second time. I used to hesitate in looking into the solution which wasted a lot of my time.

After you have solved the problem, analyze it completely, speak aloud and walk yourself through the naive to most optimised solution of the problem.

  1. Estimate the time and space complexities
  2. Check for any repetitive or unnecessary loops.
  3. Decreasing the time complexity with increment of space utilisation (Trade-off between space and time)
  4. Scrap this solution and think about new one.

#GoodLuck #Happycoding

要查看或添加评论,请登录

Jitendra kumar的更多文章

  • My Vipassana Meditation Experience at Bodh Gaya, Bihar, India

    My Vipassana Meditation Experience at Bodh Gaya, Bihar, India

    I attended a 10-day( August 1-12, 2024) Vipassana meditation course by S.N.

  • Pm Narendra Modi inaugurates 1600 years old Nalanda University campus

    Pm Narendra Modi inaugurates 1600 years old Nalanda University campus

    19 June 2024 : PM Narendra Modi : India should once again be recognised as the most prominent knowledge centre in the…

  • Coroutine

    Coroutine

    What are coroutines? A coroutine is (Very Very)Light Weight Thread. Coroutines have managed by Thread Pool.

  • Dependency Injection: Dagger-Hilt vs Koin

    Dependency Injection: Dagger-Hilt vs Koin

    Why Koin and Dagger-Hilt? If you are an Android developer, chances are you might have used Dagger, which, undoubtedly…

  • Coding tips

    Coding tips

    Practice is the key to excel in coding. GeeksForGeeks, also known as the encyclopedia of coding has numerous questions…

社区洞察

其他会员也浏览了