Code Challenges

Get better at coding with practice problems.

Coding Challenges

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

Showing 19 of 37 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 movingAverageStreamLast method that returns the last moving average value for a fixed-size window. Solved

Intermediate

Implement the circularTourStartIndex method that returns a starting petrol pump index that can complete the circular tour. Solved

Intermediate

Implement the taskSchedulerIntervals method that returns the minimum intervals required to schedule tasks with cooldown. Solved

Proficient

Implement the shortestPathBinaryMatrixLength method that returns the shortest path length through a binary matrix. Solved

Intermediate

Implement the openLockMinimumTurnsSimple method that returns the minimum turns needed to reach the lock target. Solved

Intermediate

Implement the perfectSquaresBfsSteps method that returns the minimum number of perfect squares that sum to n. Solved

Intermediate

Implement the numberOfIslandsBfsCount method that counts islands in a grid using breadth-first search. Solved

Intermediate

Implement the rottingOrangesMinutes method that returns the minutes required for all fresh oranges to rot. Solved

Intermediate

Implement the firstNonRepeatingCharacterStream method that returns the first non-repeating character after processing a stream. Solved

Proficient

Implement the slidingWindowMaximumDeque method that returns maximum values for every sliding window of size k. 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