This function checks whether a given string containing only '(', ')' and '*' characters is valid. A string is considered valid if it follows the rules defined above.

186

Dec 13
Given a stack of integers, the function returns the sum of the elements in the stack.

161

Dec 11
This function takes in a string consisting only of parentheses and outputs whether or not the string is balanced. A string is balanced if every open parenthesis has a corresponding close parenthesis and there are no unmatched parentheses.

200

Dec 10
This problem asks the programmer to return the sum of all integers at even indices in a given list. For example, given the list [1, 2, 3, 4, 5], the output would be 6 (2 + 4).

180

Dec 09
Given a simple expression string consisting of parentheses, plus/minus signs, and non-negative integers, implement a basic calculator to evaluate the string.

205

Dec 08
The function should return true if the stack is in sorted order (increasing order), and false otherwise.

162

Dec 06
This problem asks you to reverse a string using a stack. An example input and output is provided.

197

Dec 05
A stack is a data structure that supports push, pop, and min operations in constant time.

199

Dec 04