DEV Community

Himanshu Gupta
Himanshu Gupta

Posted on

How to solve a DSA problem

Hers is Golden Word
Without go into water we can not become swimmers.

These are the steps that you should follow:

  • Get a question (Start with simple question)
  • Understand the question completely(Try Until it clear to you).
  • Get an estimate of the required complexity(Ask to interview) .
  • Come up with edge cases based on the constraints.
  • Come up with a brute-force solution. Verify if it will pass.
  • Optimize, verify and repeat this step.
  • Dry-run your solution on the sample tests and edge cases.
  • Code and test with the sample tests and edge cases.
  • Submit. Debug and fix, if the solution does not work for yo.

Image description

Top comments (0)