Challenge: Sorted Insert

Learn how to solve the sorted insert problem using stack.

Problem

Given a stack whose elements are sorted, write a function that will insert elements in the sorted order, with the highest element at the top and the lowest element at the bottom.

Level up your interview prep. Join Educative to access 70+ hands-on prep courses.