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

Implement the lruCacheGetOutputSum method that simulates an LRU cache and returns the sum of get results. Solved

Implement the minimumMeetingRoomsHeap method that returns the minimum number of meeting rooms required for all intervals. Solved

Implement the smallestRangeFromListsWidth method that returns the width of the smallest range covering all sorted lists. Solved

Implement the reorganizeStringPossible method that checks whether the string can be rearranged so adjacent characters differ. Solved

Implement the lastStoneWeightHeap method that returns the final stone weight after repeatedly smashing the two heaviest stones. Solved

Implement the kClosestPointsCount method that counts points included among the k closest points to the origin. Solved

Implement the minimumCostConnectRopes method that returns the minimum total cost needed to connect all ropes. Solved

Implement the findMedianFromDataStreamFloor method that returns the floor of the median from a stream of values. Solved

Implement the mergeKSortedArraysLength method that returns the total length after merging k sorted arrays. Solved

Implement the topKFrequentElementsCount method that counts how many elements are included in the top k frequent values. Solved

Implement the kthLargestElementHeap method that returns the kth largest value using heap logic. Solved

Intermediate

Implement the longestSubarrayZeroSumLength method that returns the length of the longest subarray with sum zero. Solved

Intermediate

Implement the minimumIndexSumCommonString method that returns the common string with the smallest index sum. Solved

Intermediate

Implement the findAllDuplicatesCount method that counts duplicate values found in the array. Solved

Intermediate

Implement the validSudokuRowsSimple method that checks whether each row of a Sudoku board is valid. Solved

Intermediate

Implement the topKFrequentValuesCount method that counts how many values belong to the top k frequent values. Solved

Intermediate

Implement the isomorphicStringsCheck method that checks whether two strings follow the same character mapping pattern. Solved

Implement the containsDuplicateWithinK method that checks whether duplicate values appear within distance k. Solved

Intermediate

Implement the subarraySumEqualsKCount method that counts subarrays whose sum equals k. Solved