Brainteaser LeetCode Problems: All 16,
With Python Solutions
Every problem in this library that LeetCode tags Brainteaser. 14 of them carry a complete Python solution, a worked example and the time and space complexity of the approach.
- Easy
- 2
- Medium
- 13
- Hard
- 1
Brainteaser problems by difficulty
Problems with a complete Python solution are listed first, then by ascending problem number.
Easy (2)
| No. | Problem | Topics |
|---|---|---|
| 0292 | Nim Game | |
| 1025 | Divisor Game |
Medium (13)
| No. | Problem | Topics |
|---|---|---|
| 0319 | Bulb Switcher | |
| 1033 | Moving Stones Until Consecutive | |
| 1227 | Airplane Seat Assignment Probability | |
| 1503 | Last Moment Before All Ants Fall Out of a Plank | |
| 2396 | Strictly Palindromic Number | |
| 2419 | Longest Subarray With Maximum Bitwise AND | |
| 2425 | Bitwise XOR of All Pairings | |
| 2568 | Minimum Impossible OR | |
| 2731 | Movement of Robots | |
| 2745 | Construct the Longest New String | |
| 2749 | Minimum Operations to Make the Integer Zero | |
| 1908 | Game of NimPremium | |
| 2505 | Bitwise OR of All Subsequence SumsPremium |
Hard (1)
| No. | Problem | Topics |
|---|---|---|
| 0810 | Chalkboard XOR Game |
Eyes only
When the Brainteaser problem arrives live.
In the live round, Stealth Interview reads the problem off your screen, returns a working solution with a step-by-step explanation and its time and space complexity, and transcribes what the interviewer says. It's a desktop app for macOS and Windows, invisible to screen sharing.
Keep exploring
Other topics
- Array1,569
- String672
- Hash Table588
- Math485
- Dynamic Programming481
- Sorting392
- Greedy346
- Depth-First Search289
- Binary Search253
- Database249
- Tree225
- Breadth-First Search223
- Matrix216
- Two Pointers201
- Bit Manipulation194
- Binary Tree174
- Heap (Priority Queue)163
- Prefix Sum157
- Stack157
- Simulation144
- Graph138
- Counting126
- Design122
- Sliding Window116