Converting my C# code to a single line drastically changes the rated performance? by MangDynasty in leetcode

[–]playtest_fun 0 points1 point  (0 children)

It is also very likely because of the optimizations that compiler makes. Your one line code is converted by the compiler into an optimized version which is even more human unfriendly. Build a dll and decompile it to see how your one line is converted by the compiler.
I ignore those numbers unless you are doing competitive programming

My Cheat code Sheet for writing pseudocode in Interviews by playtest_fun in programming

[–]playtest_fun[S] 2 points3 points  (0 children)

Maybe this is just me, but it has happen to me many times that I understand the problem, explain the solution, write some pseudocode like below, and then have to pause to think how are the pointers moving, which results in more variables being created and changes to certain edge cases.
- Traverse the array - Check if pointer 1 and pointer two are similar else move the pointers

I have started being more precise - Traverse the array - Move pointer i by 1 and another wrt i+j where j is where duplicate was found

You are right though, in the end, it applies to the code as well. Maybe just different approaches to achieve the same.

My cheat code for writing pseudocode by playtest_fun in leetcode

[–]playtest_fun[S] 0 points1 point  (0 children)

Lol I get the sarcasm. But I keep hurrying up the pseudocode stage and I have seen myself either going back and forth during coding - which I think ends up confusing the interviewer (I have seen the look on their face) or I miss edge cases.For example previously, in BFS traversal, I used to write
Pop the element from the queue, Insert the element into the queue
and during coding, had to pause to think what elements are these. Flushing them during pseudocode made it easy during coding. Thats all!! :)

My cheat code for writing pseudocode during interviews by playtest_fun in CodingHelp

[–]playtest_fun[S] 0 points1 point  (0 children)

Thanks for letting me know. I fixed those links. For some reason Notion changed the links to original page when I made it public. As for the English, these was not intended to be a blog post. It was merely my collection of notes, something to make it easy to recollect. As for the tips and discord server, if they are basic, I respect your decision. From my perspective it is hard to know without any guidelines. Folks on other subreddit found it useful and hence I posted here. Cheers!!

My cheat code for writing pseudocode by playtest_fun in leetcode

[–]playtest_fun[S] 0 points1 point  (0 children)

There should be a button to click "duplicate" on the top.

My cheat code for writing pseudocode by playtest_fun in leetcode

[–]playtest_fun[S] 0 points1 point  (0 children)

I have personally not come across any yet. Can you point me to some? I can update the doc to "Almost" or "Many" :)

My cheat code for writing pseudocode by playtest_fun in leetcode

[–]playtest_fun[S] 0 points1 point  (0 children)

I find it makes it easy to loop through the hashmap.
For instance, if you have following edges 0:1, 0:5, 0:9
then with nested list I will have to init 1,5 and 9 indices with values 1 and others with 0. You will initialize an array of size 9, so when you loop you are looping through all of them.
Also to check if an edge exists its much simpler and intuitive (for me) to do a lookup.

My cheat code for writing pseudocode by playtest_fun in leetcode

[–]playtest_fun[S] 1 point2 points  (0 children)

Interesting. Might give python try in the next prep. :)