Hacker News new | ask | show | jobs
by timb 5304 days ago
http://i.imgur.com/o1A7M.png
4 comments

There's also this: http://i.imgur.com/vvKOR.png
That one's really damning. It's implying that they're using some sort of syntactic equivalence to compare solutions, which is a big no-no. It's not that difficult to generate a bunch of tests and run both solutions through an interpreter, and in this case, it's not that hard to compare them both on every possible input by running them through an abstract interpreter.
Yeah I got that and

arr.push(x) marked wrong instead of their arr.add(x)

Not to mention, their example said that the return value would be (3 + 5) / 2, as opposed to just returning 4.

Here I was, trying to figure out how to write a class named Stack, that behaved like a list, had a push(self,x) method that did an append. Also, adjust the "op()" function so that instead of calculating the results of a mathematical operation, it returned a string holding the operation (like "(3 + 5)") being sure to add parentheses if there was a precedence issue.

...all in one line of code.

yeah, that one particular challenge was screwed up. The other ones were much better.

Yeah, I got annoyed by that too. The fact you have to guess what calls they used makes this distinctly not a bug fixing challenge.
The one-line rule is your friend.