Challenge: Sort Values in a Stack
Try to solve Sort Values in a Stack problem.
We'll cover the following...
Statement
Given a stack of integers, stack
, sort its elements in ascending order. In the resulting stack, the smallest element should be at the top.
Constraints:
stack.length
stack[i]
Examples
Access this course and 1400+ top-rated courses and projects.