Leetcode Problems

Joined
Jul 27, 2024
Messages
1
Reaction score
0
I am not able to solve leetcode medium problems no matter how much i think i identify the pattern but not able to implement it.I also do not see solutions or discussions as i feel guilt that i am cheating.Please can somebody help me.
 
Joined
Sep 21, 2022
Messages
189
Reaction score
26
Reading another person's program is not cheating. Making a minor change, then calling all of it your work, now that's cheating.

IMO sites like leetcode are just tricking people into reading adverts.

To learn a programming language, nothing beats a good manual. Read the manual, all the answers are in there, its as simple as that. Still confused? Read it again.

To write a program, start with a logic diagram; flowchart, or structure diagram, or state transition diagram. Whatever format feels natural to you.

Convert the logic diagram into pseudo code.

Desk check the pseudo code. This means using a piece of paper to keep track of the value of every variable, use your brain as the CPU.

Convert the pseudo code into Java, or whatever language you want. This is the first stage where an actual computer is involved.

Test the program. Job done.

As programmers get better, they skip stages. Desk checking is usually the first to go.

If beginners try to go from problem specification directly to code, they will hit a wall.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,056
Messages
2,570,443
Members
47,090
Latest member
LillieRipl

Latest Threads

Top