We run a loop from the first index to the 2nd last index.
And for each index, we run another loop from the next index to the last index.
If all the values to the right of that index are smaller than the index, we simply add the value in our answer data structure.
We run a loop from the first index to the 2nd last index. And for each index, we run another loop from the next index to the last index. If all the values to the right of that index are smaller than the index, we simply add the value in our answer data structure.