I stumbled upon this line of code and trying to understand what rightspval[stack.pop()] = i, mean?

```
        for i in range(1,n):
        while stack and A[stack[-1]] < A[i]:
            rightspval[stack.pop()] = i
        stack.append(i)

```