Showing 3 of 3 questions
Determine if a string containing parentheses is valid. A valid string has matching and properly nested opening and closing parentheses.
#1. Valid Parentheses
Design a stack that supports push, pop, top, and retrieving the minimum element in constant time. You need to implement a stack with an additional function to efficiently get the minimum value.
#2. Min Stack
Find the element that appears more than n/2 times in a given array of size n. Essentially, you need to identify the majority element.
#3. Majority Element
Page 1 of 1 · 3 total