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

Implement the sortLinkedListValues method that sorts linked list values and returns the sorted list. Solved

Implement the reorderLinkedListValues method that reorders linked list values in first-last alternating order. Solved

Implement the intersectionLinkedListValue method that returns the first common value between two linked lists. Solved

Implement the addTwoNumbersLinkedList method that adds two numbers represented by linked lists and returns the result list. Solved

Implement the palindromeLinkedListCheck method that checks whether the linked list values form a palindrome. Solved

Implement the middleNodeLinkedList method that returns the value stored at the middle node of the linked list. Solved

Implement the removeNthNodeFromEnd method that removes the nth node from the end and returns the updated list values. Solved

Implement the mergeTwoSortedLinkedLists method that merges two sorted linked lists and returns the sorted values. Solved

Implement the detectCycleLinkedListValues method that checks whether the linked list has a cycle at the given position. Solved

Implement the reverseLinkedListInterview method that returns linked list values after reversing the list. Solved

Intermediate

Implement the boatsToSavePeopleCount method that returns the minimum boats needed under the weight limit. Solved

Implement the sortedSquaresTwoPointers method that returns squares of sorted values in sorted order. Solved

Implement the mergeSortedArrayInPlaceResult method that merges two sorted arrays into a sorted result. Solved

Intermediate

Implement the fourSumPairCountSimple method that counts quadruplets that produce the target sum. Solved

Implement the minimumDifferencePairSorted method that returns the smallest difference between any pair after sorting. Solved

Implement the validPalindromeAfterOneRemoval method that checks whether a text can become a palindrome after removing at most one character. Solved

Implement the trappingRainWaterAmount method that calculates how much rain water can be trapped between bars. Solved

Implement the removeDuplicatesSortedArrayLength method that returns the length after removing duplicates from a sorted array. Solved

Implement the threeSumTripletCount method that counts unique triplets whose sum is zero. Solved