In my previous code challenge, I asked you to write a function that tells you which of its lines has been removed.
The instructions were:
Write a function that contains five lines.
If you run the function as-is, it should return 0.
If you remove any one of the five lines and run the function, it should tell you which of the lines has been removed (e.g., if you remove the final line it should return 5).
Now, let's try something a teensy bit more difficult.
Follow the same rules as above, but this time, the function should return an array telling you which TWO lines have been removed.
So, for instance, if I remove lines 1 and 5, the return value should be [1,5], and if I remove lines 3 and 4, the return value should be [3,4].
Again, if no lines are removed, the function should return 0. Bonus points if you can also handle the one-line-removed case, but it's not strictly necessary that you do so.
Can you make use of helper functions? Yes, but only if you have to. A single self-contained function that pulls this off is the ideal.
As with the last challenge, the highest upvoted solution wins. I'll pick the winner in a week, or sooner if no new submissions have been received in 24 hours.