Python sorting and searching problems
Sort, search and binary search in Python, on problems with tests that check your solution at once.
Beginner
Intermediate
- 60. Integer Square RootSquare roots of enormous numbers, exact to the last digit60 XP10 min
- 75. Sort by FrequencyLine up a list by how often each value turns up65 XP10 min
- 83. K-th Largest ItemWho came in k-th place on an unsorted scoreboard?70 XP12 min
- 89. First and Last PositionWhere does a run of repeated values start and stop?75 XP15 min
- 265. A Researcher's H-IndexOne number that sums up how often a scientist's papers get cited60 XP10 min
- 316. Find the PeakA mountain road climbs, then drops: where exactly is the top?75 XP14 min
- 319. Rank the LeaderboardTwo players tie for second place. So who comes third?75 XP15 min
Advanced
- 143. Minimum Reading SpeedHow slowly can you read and still finish every book in time?130 XP25 min
- 157. Search a Rotated Sorted ListA sorted list was cut in two and its halves swapped140 XP25 min
- 167. Count InversionsHow far is this list from being sorted?165 XP35 min
- 394. Spread Out the SensorsPlace the sensors so that even the closest two are far apart140 XP30 min
- 411. K-th Number in a Times TableA giant times table in sorted order: which number sits in position k?150 XP30 min
- 417. Split a Long Hike Into DaysA long trail and a set number of days: make the hardest day as short as you can150 XP30 min
Expert
- 199. Median of Two Sorted ListsThe middle value of two sorted lists put together280 XP50 min
- 466. K-th Smallest Pair DistanceEvery pair of houses on a long road, sorted by distance: which gap is k-th?240 XP45 min
- 490. Stretches With a Total in RangeHow many runs of days ended with a total inside the target band?260 XP50 min
Other topics
- Python Basics
- Strings
- Lists
- Dictionaries and sets
- Loops
- Functions
- Math
- Two pointers
- Sliding window
- Stacks and queues
- Recursion and backtracking
- Dynamic programming
- Greedy
- Graphs
- Trees
- Bit manipulation
- Classes
- Iterators and generators
- Parsing
- Simulation
- Python idioms
- Regular expressions
- Codes and ciphers
- Working with data
- Grids and matrices
- Geometry
- Games and puzzles
- Heaps
- Data structures
Or see every challenge, with study plans, today's challenge and duels.