←back to thread

165 points fzliu | 1 comments | | HN request time: 0s | source
Show context
toomuchtodo ◴[] No.41842178[source]
The OG LeetCode. Highly recommend, helpful for becoming fluent in a programming language.
replies(4): >>41842916 #>>41843127 #>>41844206 #>>41846082 #
llm_trw ◴[] No.41843127[source]
I wouldn't. The majority of problems there have mathematical optimizations which real problems never do. Worse if you start thinking in the way those problems encourage you to your programs will be completely invalidated even with a tiny change in the spec.

A good set of questions would be something between the advent of code - where the problems are hard because the spec is so bad on purpose - and project Euler - where the spec is so exact you don't really need a computer to solve the problems with enough thinking.

Something like 'plot the histogram of collatz sequence lengths of the first 100,000 numbers'.

replies(1): >>41845696 #
1. KeplerBoy ◴[] No.41845696[source]
The AoC spec isn't bad though?

The text always clearly states how your code has to behave, albeit it doesn't spell out every edge case you might overlook. Real world specs on the other hand is often contradictory and impossible to fullfil.