Oracle interview question

LeetCode Medium problems about Stacks and dynamic programming.