Coding challenges

Leaderboard

Start with the basics or work through classic problems. Solve each one in any of 20 languages: Run checks your code on the examples, and Submit checks it against every test.

Daily challenge · Saturday 21 November

Work out an arithmetic expression written in postfix order.

Sign in to keep a daily streakSolve

Study lists

All lists

All challenges

Challenges
75
Easy
39
Medium
24
Hard
12

Sign in to submit solutions, save challenges and keep track of what you’ve solved.

75 of 75
StatusChallengeLevelSave
Say helloRead a name and greet that person.Easy
Sum of two numbersRead two whole numbers and print their sum.Easy
Even or oddSay whether a whole number is even or odd.Easy
Largest of threePrint the largest of three numbers.Easy
Leap yearDecide whether a year is a leap year.Easy
Celsius to FahrenheitConvert a temperature from Celsius to Fahrenheit.Easy
Grade from scoreTurn a test score into a letter grade.Easy
FizzBuzzCount to n, saying Fizz, Buzz or FizzBuzz for multiples of 3 and 5.Easy
Multiplication tablePrint the times table of a number from 1 to 10.Easy
Right triangleDraw a triangle of stars, one more on each line.Easy
Sum of a listRead a list of numbers and print their total.Easy
Count the vowelsCount how many vowels a line of text has.Easy
Reverse a linePrint a line of text backwards.Easy
Count the wordsCount the words in a line of text.Easy
Two SumFind the two positions whose numbers add up to a target.Easy
Valid PalindromeCheck whether text reads the same both ways, ignoring case and punctuation.Easy
Palindrome NumberCheck whether a number's digits read the same both ways.Easy
Valid ParenthesesCheck that every bracket is closed by the right kind, in the right order.Easy
Merge Sorted ArraysMerge two sorted arrays into one sorted array.Easy
Best Time to TradePick one day to buy and a later day to sell for the biggest profit.Easy
Contains DuplicateCheck whether any number appears twice.Easy
Valid AnagramCheck whether one word is a rearrangement of another.Easy
Missing NumberFind the one number missing from 0 to n.Easy
Single NumberEvery number appears twice except one; find it.Easy
Move ZerosMove every zero to the end, keeping the other numbers in order.Easy
Binary SearchFind a number's position in a sorted array in log time.Easy
Climbing StairsCount the ways to climb n stairs taking one or two at a time.Easy
Majority ElementFind the value that fills more than half of the array.Easy
Roman to IntegerTurn a Roman numeral into a number.Easy
Longest Common PrefixFind the longest start that every word shares.Easy
Count Set BitsCount the 1s in a number's binary form.Easy
Plus OneAdd one to a number stored as an array of digits.Easy
First Unique CharacterFind the first letter that appears only once.Easy
Squares of a Sorted ArraySquare every number of a sorted array and keep it sorted.Easy
Longest Substring Without RepeatsFind the longest stretch of text with no repeated character.Medium
Product Except SelfFor each position, multiply every other number, without dividing.Medium
Maximum SubarrayFind the largest sum of a run of consecutive numbers.Medium
Top K FrequentReturn the k values that appear most often.Medium
Three SumFind every distinct triple of numbers that adds up to zero.Medium
Container With Most WaterPick two walls that hold the most water between them.Medium
Rotate MatrixTurn a square grid of numbers 90 degrees clockwise.Medium
Spiral MatrixRead a grid in a clockwise spiral from the outside in.Medium
Number of IslandsCount the separate islands of land on a grid map.Medium
Coin ChangeMake an amount with as few coins as possible.Medium
Longest Increasing SubsequenceFind the longest strictly rising sequence you can pick out of an array.Medium
Search in a Rotated ArrayBinary-search a sorted array that has been rotated.Medium
Merge IntervalsMerge every pair of overlapping intervals.Medium
Days Until WarmerFor each day, count the days until a warmer one.Medium
House RobberTake the most from a row of houses without taking two neighbours.Medium
Jump GameDecide whether you can jump from the first square to the last.Medium
Unique PathsCount the paths across a grid moving only right or down.Medium
Subarray Sum Equals KCount the runs of consecutive numbers that add up to k.Medium
Generate ParenthesesList every balanced string of n pairs of parentheses.Medium
Evaluate Reverse Polish NotationWork out an arithmetic expression written in postfix order.Medium
Trapping Rain WaterWork out how much rain water a skyline of bars holds.Hard
Median of Two Sorted ArraysFind the median of two sorted arrays taken together.Hard
Edit DistanceCount the fewest single-letter edits that turn one word into another.Hard
Longest Valid ParenthesesFind the longest balanced run in a string of parentheses.Hard
Largest Rectangle in a HistogramFind the biggest rectangle that fits under a bar chart.Hard
Sliding Window MaximumReport the largest number in every window of k as it slides along.Hard
Minimum Window SubstringFind the shortest stretch of text that contains every letter of another string.Hard
N QueensCount the ways to place n queens on an n × n board with none attacking another.Hard
Word LadderFind the shortest chain of one-letter changes from one word to another.Hard
Pattern MatchingMatch text against a pattern with . and * wildcards.Hard
Reverse a Linked ListTurn a linked list around so its last node comes first.Easy
Merge Two Sorted ListsJoin two sorted linked lists into one sorted list.Easy
Middle of a Linked ListFind the middle node of a linked list in one pass.Easy
Depth of a TreeCount the levels of a binary tree, from the root to its deepest leaf.Easy
Invert a TreeMirror a binary tree, swapping every node's left and right children.Easy
Remove the Nth Node From the EndUnlink the node n places from the end of a linked list.Medium
Add Two Numbers in ListsAdd two numbers stored digit by digit in linked lists.Medium
Tree Level by LevelList a binary tree's values one level at a time, left to right.Medium
Valid Search TreeCheck whether a binary tree keeps the search tree order everywhere.Medium
Reverse in Groups of kReverse a linked list k nodes at a time, leaving a short last group as it is.Hard
Best Path Sum in a TreeFind the path through a binary tree whose values add up to the most.Hard

Practise in your language