Code Challenges

Get better at coding with practice problems.

Coding Challenges

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

Showing 12 of 50 problems

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

Intermediate

Implement the sortArrayByAbsoluteValue method that returns the array sorted according to absolute value. Solved

Implement the findSmallestMissingPositiveSorted method that finds the smallest positive integer missing from a sorted array. Solved

Implement the sortOnlyEvenNumbers method that sorts only the even numbers while keeping odd numbers in their positions. Solved

Learner

Implement the insertionSortArray method that returns the array after sorting it using insertion sort logic. Solved

Learner

Implement the bubbleSortArray method that returns the array after sorting it using bubble sort logic. Solved

Learner

Implement the selectionSortArray method that returns the array after sorting it using selection sort logic. Solved

Learner

Implement the isArraySortedAscending method that checks whether the array is sorted in ascending order. Solved

Implement the mergeTwoSortedArrays method that merges two sorted arrays into one sorted result array. Solved

Implement the method firstOccurrence that returns the first index of a target value in a sorted array. Solved