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 longestIncreasingPathMatrix method that returns the longest strictly increasing path length in a matrix. Solved

Implement the shortestSubarrayAtLeastKLength method that returns the shortest subarray length with sum at least k. Solved

Implement the boundedMaximumSubarrayCount method that counts subarrays whose maximum value stays within a given range. Solved

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 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 matrixBlockSumCenter method that returns the block sum around the center using distance k. Solved

Implement the countSquareSubmatricesOnes method that counts square submatrices that contain only 1 values. Solved

Implement the wordSearchMatrixExists method that checks whether the word exists in the matrix path. Solved

Implement the maximalSquareMatrixArea method that returns the area of the largest square containing only 1 values. Solved