Coding practice problems
Pick a problem, write your answer in JavaScript or Python, and press Run to check it against the examples. No account needed. Sign in when you want to test it against every hidden case.
- Two SumEasyArraysHash mapSolve Two Sum
- Contains DuplicateEasyArraysHash setSolve Contains Duplicate
- Valid PalindromeEasyStringsTwo pointersSolve Valid Palindrome
- Best Time to Buy and Sell StockEasyArraysGreedySolve Best Time to Buy and Sell Stock
- Reverse StringEasyStringsTwo pointersSolve Reverse String
- Longest Substring Without Repeating CharactersMediumStringsSliding windowHash mapSolve Longest Substring Without Repeating Characters
- Group AnagramsMediumStringsHash mapSortingSolve Group Anagrams
- Product of Array Except SelfMediumArraysPrefix sumSolve Product of Array Except Self
- Trapping Rain WaterHardArraysTwo pointersStackSolve Trapping Rain Water
- Median of Two Sorted ArraysHardArraysBinary searchDivide and conquerSolve Median of Two Sorted Arrays
How it works
Each problem has a few example tests that you can see, and many hidden tests. Press Run to check your code against the examples. Your code runs on our server in a safe sandbox, and a run takes a few seconds.
Press Submit to check your answer against every hidden test and save your progress. Submit needs a free DevHives account.
Want to try code without a problem? Use the free JavaScript or Python compiler.