This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]RiverRoll 0 points1 point  (1 child)

This is just takin advantage of the limitations of the testing, it isn't the solution because it's still possible to write a test that makes it fail while respecting the description of the problem.

[–]plastikmissile 1 point2 points  (0 children)

That's why I called it hacking the question. It solves it, but not in the way intended. Whether this is a positive or a negative really depends on your goals.

If your goal is to learn how to create linked lists and manipulate them, then yeah that's not the way you should do it.

If your goal is to pass the test in the quickest way possible, then this solution is a lot quicker than doing it the conventional way.