Leetcode preparation

While working out/ preparing the problems, do you actually execute the code and see Or just put down the code on whiteboard/ paper?

New
bxkCw Jan 19, 2018

whiteboard

Accenture RimRax Jan 19, 2018

First, I write it on paper/whiteboard, then run it on leetcode, once it’s accepted, I look at how it compares to others’ code on the runtime distribution chart and optimize it if its runtime is high compared to others.

Microsoft MIta60 Jan 20, 2018

Wait Leetcode shows you the runtime distributions of the submissions?

Accenture RimRax Jan 20, 2018

Yes, click on ‘Submissions’ tab, click on an Accepted submission, and it’ll show you where it’s at in the distribution. It only shows this for problems that have a sufficient # of accepted submissions though.

PayPal hdi644f Jan 19, 2018

Time each and every question and track progress.

Amazon Trump,D Jan 19, 2018

Won’t this slow down your progress for covering larger set of questions? How about using geeks4geeks which have answers as well ?

PayPal hdi644f Jan 19, 2018

True. I meant the one you're practicing, time it so that you can improve. If you're able to solve them consistently, you can skip the ones which have same logic. After solving a lot I've realized that a lot of problems in dfs, bfs and trees can be skipped. But in arrays each one is different in it's own way.

Microsoft git_merge Jan 22, 2018

Linqpad FTW... You will forget after days let's take backtracking like permutations, Number of lines of code is less but doing dump for each function call gives you more understanding

Microsoft git_merge Jan 22, 2018

C# only..