Editor

Challenges

Python problems with tests, from your first function to contest-level algorithms, each with a timer, stars and a duel mode.

0of 642
Beginner0/179
Intermediate0/197
Advanced0/167
Expert0/99

No streak yet

  1. ✓
  2. ✓
  3. ✓
  4. ✓
  5. ✓
  6. ✓
  7. ✓

0 of 1926 stars

Today's challenge

Race a friend

Same challenge, live or when you both can. The winner takes the prize pool, up to 580 XP.

This week's board

Study plans

Topics

All challenges

  1. 1.Hello WorldThe first program everyone writesBeginner Python Basics · 25 XP
  2. 2.Say HelloA personal greetingBeginner Strings · 25 XP
  3. 3.Simple MathA tiny calculator for two numbersBeginner Python Basics · 25 XP
  4. 4.Is Even?Odd or even, one number at a timeBeginner Python Basics · 30 XP
  5. 5.Maximum of TwoPick the bigger of two numbersBeginner Python Basics · 30 XP
  6. 6.Absolute ValueHow far is a number from zero?Beginner Python Basics · 35 XP
  7. 7.Capitalize WordsGive every word a capital letterBeginner Strings · 35 XP
  8. 8.Default ParametersA greeting that works with or without a nameBeginner Functions · 35 XP
  9. 9.Count ElementHow many times does it appear?Beginner Lists · 40 XP
  10. 10.Reverse a StringText, back to frontBeginner Strings · 40 XP
  11. 11.Sum of ListAdd up a list the long wayBeginner Lists · 40 XP
  12. 12.Count VowelsHow many vowels hide in the text?Beginner Strings · 45 XP
  13. 13.Find MaximumThe largest value, found by handBeginner Lists · 45 XP
  14. 14.Reverse a ListBack to frontBeginner Lists · 45 XP
  15. 15.Multiply All ArgumentsMultiply however many numbers you are givenIntermediate Functions · 55 XP
  16. 16.Sum of DigitsAdd up the digits of a numberIntermediate Loops · 55 XP
  17. 17.Palindrome CheckDoes it read the same backwards?Intermediate Strings · 60 XP
  18. 18.Remove DuplicatesEvery item once, order keptIntermediate Lists · 60 XP
  19. 19.Custom FilterKeep only the items that pass a testIntermediate Functions · 65 XP
  20. 20.FactorialThe product of every number up to nIntermediate Loops · 65 XP
  21. 21.Fibonacci SequenceThe sequence where each number adds the two beforeIntermediate Loops · 70 XP
  22. 22.FizzBuzzFizz, Buzz or a number: the classic counting gameIntermediate Loops · 75 XP
  23. 23.Prime Number CheckIs this number divisible only by 1 and itself?Intermediate Loops · 80 XP
  24. 24.Function CompositionChain two functions into oneAdvanced Functions · 85 XP
  25. 25.Memoization DecoratorTeach a slow function to remember its answersAdvanced Functions · 100 XP
  26. 26.Flatten One LevelBoxes inside a box: tip them all out onto the tableBeginner Lists · 25 XP
  27. 27.Coins at the TillHand back change using as few coins as possibleBeginner Greedy · 30 XP
  28. 28.Count the VotesThe polls have closed: time to count every ballotBeginner Dictionaries and sets · 30 XP
  29. 29.Digital RootSqueeze a huge number down to a single digitBeginner Math · 30 XP
  30. 30.Missing LettersWhich letters of the alphabet never show up in this sentence?Beginner Strings · 30 XP
  31. 31.Power of TwoIs this number made by doubling 1 again and again?Beginner Bit manipulation · 30 XP
  32. 32.Raise to a PowerRepeated multiplication, built without the shortcutBeginner Recursion and backtracking · 30 XP
  33. 33.Reverse the Word OrderRead a sentence back to front, one whole word at a timeBeginner Strings · 30 XP
  34. 34.Caesar CipherSlide every letter along the alphabet to hide a messageBeginner Strings · 35 XP
  35. 35.Clock Time to SecondsHow many seconds long is a video that runs 1:02:03?Beginner Parsing · 35 XP
  36. 36.Endless FibonacciA sequence that never runs out, served one number at a timeBeginner Iterators and generators · 35 XP
  37. 37.Most FriendsWho has the biggest circle of friends?Beginner Graphs · 35 XP
  38. 38.Move Zeros to the EndSweep every zero to the back of the lineBeginner Two pointers · 35 XP
  39. 39.The Missing NumberEvery number from zero upwards is here, except oneBeginner Lists · 35 XP
  40. 40.Best K Days in a RowA shop's best stretch of consecutive daysBeginner Sliding window · 40 XP
  41. 41.Climbing StairsHow many different ways can you walk up a staircase?Beginner Dynamic programming · 40 XP
  42. 42.First One of a KindIn a crowd of repeats, who showed up only once?Beginner Dictionaries and sets · 40 XP
  43. 43.Hot PotatoPass it around the circle: who is the last one standing?Beginner Stacks and queues · 40 XP
  44. 44.Merge Two Sorted ListsZip two sorted lines of numbers into oneBeginner Two pointers · 40 XP
  45. 45.Mutual FollowsWho follows each other back?Beginner Graphs · 40 XP
  46. 46.Robot on a GridFollow the commands and find out where the little robot ends upBeginner Simulation · 40 XP
  47. 47.Sum of a Nested ListLists inside lists inside lists: what do all the numbers add up to?Beginner Recursion and backtracking · 40 XP
  48. 48.Balanced BracketsDoes every bracket close in the right order?Beginner Stacks and queues · 45 XP
  49. 49.Bank Account With OverdraftKeep the money right, even when the balance dips below zeroBeginner Classes · 45 XP
  50. 50.Binary SearchWhere does this number sit in a long sorted list?Beginner Sorting and searching · 45 XP
  51. 51.Change at the Ticket BoothCan the booth give every customer the right change?Beginner Greedy · 45 XP
  52. 52.Maximum Depth of a TreeHow many levels tall is this tree?Beginner Trees · 45 XP
  53. 53.Longest Common PrefixThe longest beginning that every word in the list agrees onIntermediate Strings · 55 XP
  54. 54.Mirror a TreeFlip a tree as if it stood in front of a mirrorIntermediate Trees · 55 XP
  55. 55.Rotate a ListSpin the list around without losing anyoneIntermediate Lists · 55 XP
  56. 56.Compare Version NumbersIs version 1.10 newer than 1.9? Every software update has to knowIntermediate Parsing · 60 XP
  57. 57.Compress Repeated LettersSqueeze runs of repeated letters, but only when it saves spaceIntermediate Strings · 60 XP
  58. 58.Cookies for ChildrenMake as many children happy as the cookie jar allowsIntermediate Greedy · 60 XP
  59. 59.Gray Code SequenceCount through every binary number, flipping only one bit at a timeIntermediate Bit manipulation · 60 XP
  60. 60.Integer Square RootSquare roots of enormous numbers, exact to the last digitIntermediate Sorting and searching · 60 XP
  61. 61.One-Way StreetsCan you drive to your destination without going the wrong way?Intermediate Graphs · 60 XP
  62. 62.Pair Sum in a Sorted ListTwo prices that use up the budget exactlyIntermediate Two pointers · 60 XP
  63. 63.Queue From Two StacksFirst in, first out, built from two last-in-first-out pilesIntermediate Stacks and queues · 60 XP
  64. 64.Repeats Close TogetherHas anything come back too soon?Intermediate Dictionaries and sets · 60 XP
  65. 65.Roman Numerals to IntegerWhat number is MCMXCIV hiding?Intermediate Strings · 60 XP
  66. 66.Root-to-Leaf Path SumIs there a way down the tree that adds up exactly?Intermediate Trees · 60 XP
  67. 67.Hit CounterHow many visits did the site get in the last five minutes?Intermediate Classes · 65 XP
  68. 68.Integer to Roman NumeralsWrite any year the way the Romans carved it in stoneIntermediate Strings · 65 XP
  69. 69.Jump to the EndIs the last stepping stone within reach?Intermediate Greedy · 65 XP
  70. 70.Level Order TraversalRead a tree one floor at a timeIntermediate Trees · 65 XP
  71. 71.Maximum Subarray SumThe best unbroken run in a list of ups and downsIntermediate Dynamic programming · 65 XP
  72. 72.Primes Up to NEvery prime number, all the way up to a limitIntermediate Math · 65 XP
  73. 73.Reverse Polish CalculatorArithmetic with no brackets, where the operator comes lastIntermediate Stacks and queues · 65 XP
  74. 74.Reverse the BitsRead a 32-bit number in the mirrorIntermediate Bit manipulation · 65 XP
  75. 75.Sort by FrequencyLine up a list by how often each value turns upIntermediate Sorting and searching · 65 XP
  76. 76.Tidy a File PathUntangle a folder path full of dots and extra slashesIntermediate Stacks and queues · 65 XP
  77. 77.Two SumSomewhere in the list, two numbers make the targetIntermediate Dictionaries and sets · 65 XP
  78. 78.Common to Every ListWhat do all the shopping lists have in common?Intermediate Lists · 70 XP
  79. 79.Count the IslandsHow many separate islands are on this map?Intermediate Graphs · 70 XP
  80. 80.Flatten a Nested DictionarySquash layers of nested settings into a single levelIntermediate Recursion and backtracking · 70 XP
  81. 81.Friend GroupsHow many separate circles of friends are there?Intermediate Graphs · 70 XP
  82. 82.House RobberThe most loot from a street without setting off an alarmIntermediate Dynamic programming · 70 XP
  83. 83.K-th Largest ItemWho came in k-th place on an unsorted scoreboard?Intermediate Sorting and searching · 70 XP
  84. 84.Spiral Walk Through a MatrixWalk around the edges and work your way into the middleIntermediate Simulation · 70 XP
  85. 85.Stack With a MinimumA stack that always knows its smallest itemIntermediate Stacks and queues · 70 XP
  86. 86.Tower of HanoiMove a stack of discs, one at a time, never big on smallIntermediate Recursion and backtracking · 70 XP
  87. 87.Trailing Zeros of a FactorialHow many zeros sit at the end of a gigantic number?Intermediate Math · 70 XP
  88. 88.Convert Between BasesTranslate a number from one counting system to anotherIntermediate Math · 75 XP
  89. 89.First and Last PositionWhere does a run of repeated values start and stop?Intermediate Sorting and searching · 75 XP
  90. 90.Grid Paths with WallsCount the routes across a grid when some squares are blockedIntermediate Dynamic programming · 75 XP
  91. 91.Group the AnagramsSame letters, different words: sort them into familiesIntermediate Dictionaries and sets · 75 XP
  92. 92.Interleave StreamsDeal items from several sources like cards around a tableIntermediate Iterators and generators · 75 XP
  93. 93.Most Meetings in One RoomSqueeze as many bookings as possible into one meeting roomIntermediate Greedy · 75 XP
  94. 94.Rail Fence CipherZigzag a secret message across rails, then read it off row by rowIntermediate Strings · 75 XP
  95. 95.Right Side ViewWhat do you see standing to the right of a tree?Intermediate Trees · 75 XP
  96. 96.Ring BufferA fixed-size queue that recycles its oldest slotIntermediate Stacks and queues · 75 XP
  97. 97.Rotate the GridTurn a square picture a quarter turn to the rightIntermediate Lists · 75 XP
  98. 98.Folder SizesHow much space does each folder really take up?Intermediate Trees · 80 XP
  99. 99.Game of Life: One StepCells are born, survive or die, all at the same instantIntermediate Simulation · 80 XP
  100. 100.Longest Substring Without RepeatsThe longest stretch of text where nothing repeatsIntermediate Sliding window · 80 XP