Brainteaser LeetCode Problems: All 16, With Python Solutions
Every problem in this library that LeetCode tags Brainteaser — 16 in total, 14 of them with a complete Python solution, a worked example and the time and space complexity of the approach.
- 16 problems
- 2 Easy
- 13 Medium
- 1 Hard
Brainteaser problems by difficulty
Problems with a complete Python solution are listed first, then by ascending problem number.
Easy (2)
| # | Problem | Difficulty | Topics |
|---|---|---|---|
| 292 | Nim Game | Easy | Brainteaser, Math, Game Theory |
| 1025 | Divisor Game | Easy | Brainteaser, Math, Dynamic Programming +1 |
Medium (13)
| # | Problem | Difficulty | Topics |
|---|---|---|---|
| 319 | Bulb Switcher | Medium | Brainteaser, Math |
| 1033 | Moving Stones Until Consecutive | Medium | Brainteaser, Math |
| 1227 | Airplane Seat Assignment Probability | Medium | Brainteaser, Math, Dynamic Programming +1 |
| 1503 | Last Moment Before All Ants Fall Out of a Plank | Medium | Brainteaser, Array, Simulation |
| 2396 | Strictly Palindromic Number | Medium | Brainteaser, Math, Two Pointers |
| 2419 | Longest Subarray With Maximum Bitwise AND | Medium | Bit Manipulation, Brainteaser, Array |
| 2425 | Bitwise XOR of All Pairings | Medium | Bit Manipulation, Brainteaser, Array |
| 2568 | Minimum Impossible OR | Medium | Bit Manipulation, Brainteaser, Array |
| 2731 | Movement of Robots | Medium | Brainteaser, Array, Prefix Sum +1 |
| 2745 | Construct the Longest New String | Medium | Greedy, Brainteaser, Math +1 |
| 2749 | Minimum Operations to Make the Integer Zero | Medium | Bit Manipulation, Brainteaser, Enumeration |
| 1908 | Game of NimPremium | Medium | Bit Manipulation, Brainteaser, Array +3 |
| 2505 | Bitwise OR of All Subsequence SumsPremium | Medium | Bit Manipulation, Brainteaser, Array +2 |
Hard (1)
| # | Problem | Difficulty | Topics |
|---|---|---|---|
| 810 | Chalkboard XOR Game | Hard | Bit Manipulation, Brainteaser, Array +2 |
Keep exploring
All LeetCode topicsEvery tag with a page of its own, with the number of problems behind each.LeetCode patternsThe techniques themselves, with a Python template and complexity for each.Curated study listsBlind 75, NeetCode 150 and three more, grouped by pattern.Easy problemsStart here when the data structure is new rather than the problem.
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
When the Brainteaser problem arrives live
Stealth Interview is a desktop app for macOS and Windows. It reads the coding 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 is saying — while staying invisible to screen sharing.