Code Challenges

Get better at coding with practice problems.

Coding Challenges

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

Showing 10 of 10 problems

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