Code Challenges

Get better at coding with practice problems.

Coding Challenges

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

Showing 15 of 15 problems
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 maximumProfitMultipleTransactions method that returns the maximum stock profit using multiple valid transactions. Solved

Implement the maximumProfitSingleTransaction method that returns the best stock profit using at most one buy and one sell. Solved

Implement the canReachLastIndex method that checks whether the last index can be reached from the first index. Solved

Proficient

Implement the method minJumpsToEnd that returns the fewest jumps needed to reach the last index. Solved

Intermediate

Implement the method majorityElement that returns the value appearing more than half the time. Solved