kindly refer leetcode
Here is what the above code is Doing:
1. We are using a stack to keep track of the elements in the array.
2. We are iterating over the array and pushing the elements into the stack.
3. If the current element is greater than the top element of the stack, we pop the top element from the stack and push the current element into the stack.
4. We keep doing this until the current element is less than the top element of the stack.
5. We keep doing this for all the elements in the array.
6. At the end, the stack will contain the elements in the array in the decreasing order.
7. We then iterate over the stack and print the elements.