n students [0, ..., n-1] participate in a marathon. You are given an int array standings where standings[i] = j means that student j finished just before student i. standings[k] = -1 means that k is the first student. There are no ties. List out the students in the order in which they finished the marathon.
Example:
Input: [-1, 0, 1]
Output: [0, 1, 2]Follow-up:
There are ties.
Example:
Input: [-1, 0, 0]
Output: [0, 1, 2]