Practise
Coding challenges
21 JavaScript problems. Write a function, run the tests in your browser, and see exactly what passed. Nothing is uploaded and there is nothing to sign up for.
Your progress0 of 21 solved
Saved in this browser only.
- EasyReverse a stringWrite a function that returns a string reversed.Strings
- EasyPalindrome checkCheck whether a phrase reads the same forwards and backwards, ignoring case and punctuation.Strings
- EasyFizzBuzzThe classic: Fizz, Buzz and FizzBuzz for the numbers from 1 to n.Loops
- EasyCount the vowelsCount how many vowels a string contains.Strings
- EasySum of digitsAdd up the digits of a non-negative whole number.Numbers
- EasyRemove duplicatesRemove repeated values from an array and keep the original order.Arrays
- EasyValid parenthesesCheck that every bracket in a string is closed in the right order.Stacks
- EasyAnagram checkCheck whether two words use exactly the same letters.Strings
- EasyCapitalize each wordMake the first letter of every word a capital.Strings
- EasyTwo sumFind the two numbers in an array that add up to a target.Arrays
- MediumFibonacci numberReturn the nth Fibonacci number, fast enough for n up to 50.Recursion
- MediumLongest common prefixFind the longest starting text that all strings in a list share.Strings
- MediumMerge intervalsCombine overlapping ranges into the smallest set of ranges.Arrays
- MediumGroup anagramsPut words made from the same letters into groups.Hash maps
- MediumFirst unique characterFind the first character that appears only once.Hash maps
- MediumFlatten a nested arrayTurn an array of any depth into a single flat array.Recursion
- MediumRoman numerals to integerConvert a Roman numeral such as MCMXCIV into a number.Strings
- MediumRotate an arrayMove the last k items of an array to the front.Arrays
- MediumChunk an arraySplit an array into smaller arrays of a given size.Arrays
- MediumBinary searchFind a value in a sorted array without checking every item.Searching
- MediumWord frequencyCount how many times each word appears in a sentence.Hash maps