You are viewing a single comment's thread. Return to all comments →
This problem dosent consider these much cases, it only want you to print left only list and right only list. which can be simply achieved by going extreme left and extreme right. so yeah second is correct for this problem.
The issue is that the problem is poorly defined. You are correct, but that isn't clear from the problem statement.