Your first coding problems
New to coding problems? Start here: ten friendly problems, from fixing a small bug to your first hash map, each with hints and tests that run in your browser.
- Fix the Word Counter A word counter that counts the spaces between words, and counts one word in an empty string.
- Fix the Bill Splitter Splitting money with rounding loses or invents cents.
- Contains Duplicate Return true if any value appears at least twice.
- Valid Palindrome Is the string a palindrome, ignoring case and non-alphanumerics?
- Valid Anagram Check whether two strings are anagrams of each other.
- Two Sum Find the indices of the two numbers that add up to a target.
- Fix the Substring Check A contains-check that says no when the match is at the very start of the string.
- Binary Search Find a target in a sorted array in O(log n).
- Climbing Stairs Ways to climb n stairs taking 1 or 2 steps at a time.
- Best Time to Buy and Sell Stock Max profit from one buy and one later sell.