DEV Community

Himanshu Gupta
Himanshu Gupta

Posted on

1

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)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay