|
|
|
|
|
by jrochkind1
4326 days ago
|
|
Interesting idea. Several of the solutions I encountered are just... plain done wrong. They have a bug, sure, but the bug's actually there cause it was written in a really hacky way instead of the simplest way that would implement the function. I feel like it took me longer to find the bug in the hacky implementation than it would have to rewrite it 'right'. (For instance, the 'right' way to find "largest integer with x number of digits" is clearly and inarguably `Math.pow(10, x) - 1`. Not the hacky 4-line-with-for-loop thing they showed me with a bug in it. No?) I wonder if it would be interesting to have something like this run your solution through a simple test suite to see if it works (like my university professors used to do on our homework), instead of accepting only one exact right answer. |
|
I dunno exactly what puzzles like these demonstrate. That you spend a lot of time working in poorly written code?