leetle

Daily challenge for 2025-11-15

319. Min Stack

Design a stack that supports push, pop, top, and retrieving the minimum element.

Implement a function solve(operations, values) that performs a series of operations and returns the results.

Operations:
- "push": Push value onto stack (returns null)
- "pop": Remove top element (returns null)
- "top": Get the top element (returns the value)
- "getMin": Get the minimum element (returns the value)

Example:
Input: operations = ["push","push","push","getMin","pop","top","getMin"], values = [-2,0,-3,null,null,null,null]
Output: [null,null,null,-3,null,0,-2]

Run this challenge interactively in Python or JavaScript when the app loads.