Code Challenges

Get better at coding with practice problems.

Coding Challenges

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

Showing 17 of 17 problems

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

Implement the permutationInStringCheck method that checks whether the text contains any permutation of the pattern. Solved

Implement the maximumAverageSubarrayFloor method that returns the floor of the maximum average of a fixed-length subarray. Solved

Implement the minimumSizeSubarraySum method that returns the smallest subarray length whose sum reaches the target. Solved

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

Implement the maximumSubarraySumFixedLength method that finds the maximum sum of any contiguous subarray of length k. Solved

Implement the method minimumWindowLength that returns the length of the smallest substring containing all required characters. Solved

Implement the method longestUniqueSubstring that returns the length of the longest substring without repeated characters. Solved