Code Challenges

Get better at coding with practice problems.

Coding Challenges

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

Showing 15 of 53 problems

Implement the productArrayExceptSelf method that returns an array where each value is the product of all other values. Solved

Intermediate

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

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

Implement the findFirstRepeatedValue method that returns the first value that appears more than once while scanning the array. Solved

Implement the countDistinctValues method that counts how many different values are present in the array. Solved

Implement the hasPairWithExactDifference method that checks whether any two values in the array have the required absolute difference. Solved

Implement the method minimumWindowLength that returns the length of the smallest substring containing all required characters. Solved

Implement the method longestUniqueSubstring that returns the length of the longest substring without repeated characters. Solved

Intermediate

Implement the method countPairsWithSum that counts index pairs whose values add up to a target. Solved

Intermediate

Implement the method firstNonRepeatingChar that returns the first non-repeating character in a string. Solved

Implement the method isAnagram that takes two strings and returns true if they are anagrams of each other, otherwise returns false. Solved