Code Challenges

Get better at coding with practice problems.

Coding Challenges

Select a problem, write code, run test cases, and submit your solution.

Showing 17 of 17 problems

Implement the minStackFinalMinimum method that simulates stack operations and returns the final minimum value. Solved

Implement the evaluateRpnExpression method that evaluates an arithmetic expression written in Reverse Polish Notation. Solved

Implement the removeDuplicateLettersSmallest method that removes duplicate letters and returns the smallest possible result. Solved

Implement the longestValidParenthesesLength method that returns the length of the longest valid parentheses substring. Solved

Implement the basicCalculatorPlusMinus method that evaluates an expression containing plus and minus operations. Solved

Implement the onlineStockSpanLast method that returns the latest stock span value from the price stream. Solved

Implement the removeKDigitsMinimum method that removes k digits to form the smallest possible number. Solved

Implement the asteroidCollisionSurvivors method that returns the asteroids that remain after all collisions are resolved. Solved

Implement the minRemoveValidParentheses method that removes the minimum invalid parentheses to make the text valid. Solved

Implement the largestRectangleHistogram method that returns the largest rectangle area possible in a histogram. Solved

Implement the dailyTemperaturesWait method that returns how many days must be waited for a warmer temperature. Solved

Implement the nextGreaterElementArray method that returns the next greater value for each array element. Solved

Implement the validParenthesesMixed method that checks whether mixed parentheses are correctly balanced. Solved

Implement the isValidBracketPairString method that checks whether a bracket string has properly matched and ordered brackets. Solved

Intermediate

Implement the method isBalancedBrackets that checks whether brackets are correctly nested. Solved