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

Implement the shipPackagesWithinDaysCapacity method that returns the minimum ship capacity needed to deliver packages within given days. Solved

Implement the smallestDivisorUnderThreshold method that finds the smallest divisor satisfying a threshold condition. Solved

Implement the kthMissingPositiveNumber method that returns the kth missing positive integer from a sorted array. 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

Intermediate

Implement the boatsToSavePeopleCount method that returns the minimum boats needed under the weight limit. Solved

Implement the sortedSquaresTwoPointers method that returns squares of sorted values in sorted order. Solved

Implement the mergeSortedArrayInPlaceResult method that merges two sorted arrays into a sorted result. Solved

Intermediate

Implement the fourSumPairCountSimple method that counts quadruplets that produce the target sum. Solved

Implement the minimumDifferencePairSorted method that returns the smallest difference between any pair after sorting. Solved

Implement the validPalindromeAfterOneRemoval method that checks whether a text can become a palindrome after removing at most one character. Solved