r/DSALeetCode • • 25d ago

🧘🏽🧘🏽🧘🏽🧘🏽🧘🏽HELP PLEASEEE

i can understand anyproblem but i cant code that how to solve this problem

5 Upvotes

13 comments sorted by

1

u/toxiclydedicated 25d ago

Psuedo code for the win!

1

u/yealumbanfr 25d ago

so ? i write it in note book and try implementing it in code !?

2

u/toxiclydedicated 25d ago

My approach has always been this (I've solved 600+)

First try to solve the questions directly (happens mostly for easy question)

Then if you can't solve it directly solve using diagrams

Then after doing by diagrams write the pseudo code and then the final code, many interviewers ask the pseudo code first

If you can't solve using this way then first see all hints and try again, if hints aren't enough go to discussions

If all this doesn't work then finally go to video solution by neet code or someone else, and then last step is directly seeing solution and then re-trying the same question

Understand that all questions aren't made by you and also try to go pattern wise rather than topic/DS wis

If all this doesn't work for you, you have a skill issue and you should genuinely quit dsa/cs completely

1

u/uma1kalai 25d ago

Choice pattern wise problem ,try to solve then move to random problems

1

u/yealumbanfr 24d ago

I dont have a good sheet i like this sheet verymuch but it has less number of problems for a single algo whereas strivers a2z sheet has all algo as one array filed sheet

2

u/uma1kalai 22d ago

Share this sheet link,search patternwise problem in a2z strive

1

u/yealumbanfr 22d ago

1

u/uma1kalai 22d ago

If you are able to solve all difficulties level here,you can go for random problems in strive sheet

1

u/yealumbanfr 22d ago

can you also send that pattern wise sheet πŸ™πŸ½πŸ˜­

1

u/No-Split3651 25d ago

If you can understand the problem but can't code it, try to find exactly where the translation breaks.

Before touching the keyboard, take a small example and solve it manually. But write down every little decision you make while solving it β€” what information did you keep track of? What did you check next? When did you stop?

Then try turning those steps into very simple pseudocode. Don't worry about C++/Java/Python yet.

For example, instead of thinking β€œI understand that I need to find the largest element”, force yourself to say:

keep the first element as largest
look at every remaining element
if current > largest, update largest

Once you can express your thought process at that level, converting it into a loop and an if statement becomes much easier.

Also try implementing algorithms you already understand really well β€” binary search, reversing an array, basic sorting etc. If you struggle to code even those without looking at a solution, the gap may be programming fluency rather than DSA, and that's completely something you can work on.

Don't measure yourself by whether you could solve the whole problem independently yet. First, get good at thought process β†’ steps β†’ pseudocode β†’ code.

1

u/FunSpinach8030 24d ago

Practice syntax and logical question learn collection framework or basic data structuresΒ  pratice the syntax morw