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 159 problems

Implement the rotateImageClockwise method that returns the matrix after rotating it 90 degrees clockwise. Solved

Implement the spiralOrderTraversalLength method that returns the number of elements visited in spiral order. Solved

Implement the setMatrixZeroesCount method that counts cells affected after applying matrix zeroing rules. Solved

Intermediate

Implement the maximumUnitsTruck method that returns the maximum units that can be loaded onto the truck. Solved

Intermediate

Implement the reconstructQueueCount method that returns the number of people after reconstructing the queue. Solved

Intermediate

Implement the partitionLabelsNumber method that returns how many partitions can be made so each character appears in one part. Solved

Implement the assignCookiesMaximumChildren method that returns the maximum number of children that can receive a suitable cookie. Solved

Intermediate

Implement the minimumArrowsBalloons method that returns the minimum arrows needed to burst all balloons. Solved

Intermediate

Implement the eraseOverlapIntervalsCount method that returns how many intervals must be removed to avoid overlaps. Solved

Proficient

Implement the candyDistributionMinimum method that returns the minimum candies needed while respecting rating rules. Solved

Intermediate

Implement the gasStationCircuitStart method that returns the gas station index from which the full circuit can be completed. Solved

Intermediate

Implement the jumpGameMinimumJumpsGreedy method that returns the minimum number of jumps needed to reach the end. Solved

Implement the jumpGameReachableGreedy method that checks whether the last index is reachable using greedy logic. Solved

Implement the longestSubarrayAfterDeletingOne method that returns the longest subarray of 1 values after deleting one element. Solved

Implement the fruitIntoBasketsMaxCount method that returns the maximum fruits collected using at most two fruit types. Solved

Implement the maxConsecutiveOnesWithKFlips method that returns the longest run of 1 values after flipping at most k zeroes. Solved

Implement the longestRepeatingCharReplacement method that returns the longest substring length after replacing at most k characters. Solved

Implement the findAnagramStartCount method that counts starting positions where an anagram of the pattern appears. Solved