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

212

Nov 27
This problem asks you to reverse a string using a stack. An example input would be "abc" and the corresponding output would be "cba".

245

Nov 26
Given a list of integers, where each element represents the height of a building, find the largest rectangle that can be formed from a subset of the buildings in the list. The largest rectangle is defined as the area formed by the buildings with the largest height.

208

Nov 24
This problem is about determining if a string is balanced, meaning that every open parenthesis has a corresponding close parenthesis, and vice versa. An example of an input string that would return " true" is "(()())". An example of an input string that would return "false" is "())(".

190

Nov 24
Implement a stack with a max function that returns the maximum value in the stack.

189

Nov 22
Given a list of integers, this function will return the sum of the integers at the odd indices. For example, given the input list [1, 2, 3, 4, 5], the function will return 9.

229

Nov 22
The problem is to write a function that takes a string of parentheses and returns true if the parentheses are balanced, and false if they are not.

213

Nov 22
Given a stack of integers, this algorithm will sort the stack in ascending order. Additional stacks may be used to hold the elements, but no other data structures are allowed.

222

Nov 21