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 canPartitionEqualSum method that checks whether the array can be split into two subsets with equal sum. Solved

Implement the editDistanceSimple method that returns the minimum edit operations needed to convert one string into another. Solved

Implement the longestCommonSubsequenceLength method that returns the length of the longest common subsequence of two strings. Solved

Implement the longestIncreasingSubsequenceLength method that returns the length of the longest strictly increasing subsequence. Solved

Implement the findMedianOfTwoSortedArraysSimple method that returns the floor of the median after combining two sorted arrays. Solved

Implement the searchRangeOfTarget method that returns the first and last position of a target in a sorted array. Solved

Implement the countInversionsInArray method that counts pairs that are out of sorted order in the array. Solved

Intermediate

Implement the minimumSwapsToSortSmallArray method that returns the minimum number of swaps needed to sort the array. Solved

Implement the mergeSortedWithoutDuplicates method that merges two sorted arrays while removing duplicate values. Solved

Implement the findPairWithSortedSum method that checks whether a sorted array contains a pair with the required sum. Solved

Intermediate

Implement the kthSmallestValue method that returns the kth smallest value from the array. Solved

Implement the sortByFrequencyAscending method that sorts values by increasing frequency while resolving ties consistently. Solved