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 canReachLastIndex method that checks whether the last index can be reached from the first index. Solved

Implement the rodCuttingMaximumProfit method that finds the maximum profit obtainable by cutting a rod into pieces. Solved

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