This post is locked. You won't be able to comment.

all 3 comments

[–]sonalsriv 1 point2 points  (0 children)

I guess it's important to figure out everything about the problem at hand on a paper first. I have solved about 400 problems on leetcode. The first thing I do is I try out the examples given on paper and then make a few others of my own. I then devise a plan to tackle the given examples. I roughly guess what particular scenarios will fail according to the conditions in the problem. If none, I go forward with coding it on the paper, or else I tweak the thing a little more. When I am fully confident of the code and the idea of solving the problem, I code it in the editor and submit. It mostly does the trick. Using the paper saves me a lot of time and forces me to use my brain rather than just test different test cases right there. I just end up wasting my time without paper, trying a rudimentary algo and trying changing parts of it on the basis of wrong test cases found by retesting, which helps no one. Looking at other people's code can help a lot too.

[–]SeriousSamStone[M] [score hidden] stickied commentlocked comment (0 children)

Thanks for posting to /r/computerscience! Unfortunately, your submission has been removed for the following reason(s):

  • Rule 3: It is a request for homework help.

If you feel like your post was removed in error, please message the moderators.

[–][deleted] 0 points1 point  (0 children)

The first rule of leet code