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

Implement the longestSubstringAtMostKDistinctLength method that returns the longest substring length with at most k distinct characters. Solved

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

Implement the multiplyLargeNumbersString method that multiplies two non-negative integers represented as strings. 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 surroundedRegionsSafeCount method that counts cells not captured in a surrounded-regions board. Solved

Implement the nearestZeroDistanceSum method that returns the sum of distances from every cell to its nearest zero. Solved

Implement the burstBalloonsMaxCoins method that returns the maximum coins obtainable by bursting balloons in the best order. Solved

Implement the maxProfitWithCooldown method that returns the maximum stock profit with a one-day cooldown after selling. Solved