Simulation LeetCode Problems: All 144,
With Python Solutions

Every problem in this library that LeetCode tags Simulation. 132 of them carry a complete Python solution, a worked example and the time and space complexity of the approach.

Easy
57
Medium
77
Hard
10

Simulation problems by difficulty

Problems with a complete Python solution are listed first, then by ascending problem number.

Easy (57)

Easy problems
No.Problem
0067Add Binary
0258Add Digits
0412Fizz Buzz
0415Add Strings
0495Teemo Attacking
0566Reshape the Matrix
0657Robot Return to Origin
0682Baseball Game
0832Flipping an Image
0844Backspace String Compare
0867Transpose Matrix
0999Available Captures for Rook
1103Distribute Candies to People
1252Cells with Odd Values in a Matrix
1260Shift 2D Grid
1275Find Winner on a Tic Tac Toe Game
1389Create Target Array in the Given Order
1518Water Bottles
1560Most Visited Sector in a Circular Track
1603Design Parking System
1646Get Maximum in Generated Array
1688Count of Matches in Tournament
1700Number of Students Unable to Eat Lunch
1920Build Array from Permutation
1929Concatenation of Array
1945Sum of Digits of String After Convert
2011Final Value of Variable After Performing Operations
2022Convert 1D Array Into 2D Array
2073Time Needed to Buy Tickets
2138Divide a String Into Groups of Size k
2154Keep Multiplying Found Values by Two
2169Count Operations to Obtain Zero
2180Count Integers With Even Digit Sum
2243Calculate Digit Sum of a String
2293Min Max Game
2303Calculate Amount Paid in Taxes
2357Make Array Zero by Subtracting Equal Amounts
2460Apply Operations to an Array
2500Delete Greatest Value in Each Row
2549Count Distinct Numbers on Board
2553Separate the Digits in an Array
2558Take Gifts From the Richest Pile
2562Find the Array Concatenation Value
2582Pass the Pillow
2660Determine the Winner of a Bowling Game
2682Find the Losers of the Circular Game
2696Minimum String Length After Removing Substrings
2717Semi-Ordered Permutation
2739Total Distance Traveled
2744Find Maximum Number of String Pairs
2810Faulty Keyboard
2899Last Visited Integers
2946Matrix Similarity After Cyclic Shifts
2960Count Tested Devices After Test Operations
2974Minimum Number Game
0157Read N Characters Given Read4Premium
1243Array TransformationPremium

Medium (77)

Medium problems
No.Problem
0043Multiply Strings
0054Spiral Matrix
0059Spiral Matrix II
0289Game of Life
0498Diagonal Traverse
0537Complex Number Multiplication
0592Fraction Addition and Subtraction
0640Solve the Equation
0735Asteroid Collision
0874Walking Robot Simulation
0885Spiral Matrix III
0946Validate Stack Sequences
0950Reveal Cards In Increasing Order
0985Sum of Even Numbers After Queries
1006Clumsy Factorial
1041Robot Bounded In Circle
1094Car Pooling
1222Queens That Can Attack the King
1324Print Words Vertically
1404Number of Steps to Reduce a Number in Binary Representation to One
1409Queries on a Permutation With Key
1441Build an Array With Stack Operations
1503Last Moment Before All Ants Fall Out of a Plank
1535Find the Winner of an Array Game
1545Find Kth Bit in Nth Binary String
1562Find Latest Group of Size M
1583Count Unhappy Friends
1599Maximum Profit of Operating a Centennial Wheel
1680Concatenation of Consecutive Binary Numbers
1701Average Waiting Time
1706Where Will the Ball Fall
1801Number of Orders in the Backlog
1806Minimum Number of Operations to Reinitialize a Permutation
1823Find the Winner of the Circular Game
1860Incremental Memory Leak
1894Find the Student that Will Replace the Chalk
1910Remove All Occurrences of a Substring
1914Cyclically Rotating a Grid
2028Find Missing Observations
2043Simple Bank System
2075Decode the Slanted Ciphertext
2079Watering Plants
2105Watering Plants II
2109Adding Spaces to a String
2120Execution of All Suffix Instructions Staying in a Grid
2149Rearrange Array Elements by Sign
2161Partition Array According to Given Pivot
2177Find Three Consecutive Integers That Sum to a Given Number
2181Merge Nodes in Between Zeros
2201Count Artifacts That Can Be Extracted
2211Count Collisions on a Road
2221Find Triangular Sum of an Array
2257Count Unguarded Cells in the Grid
2295Replace Elements in an Array
2326Spiral Matrix IV
2327Number of People Aware of a Secret
2352Equal Row and Column Pairs
2365Task Scheduler II
2380Time Needed to Rearrange a Binary String
2390Removing Stars From a String
2462Total Cost to Hire K Workers
2482Difference Between Ones and Zeros in Row and Column
2502Design Memory Allocator
2507Smallest Value After Replacing With Sum of Prime Factors
2593Find Score of an Array After Marking All Elements
2596Check Knight Tour Configuration
2679Sum in a Matrix
2766Relocate Marbles
2961Double Modular Exponentiation
0348Design Tic-Tac-ToePremium
0353Design Snake GamePremium
0544Output Contest MatchesPremium
0723Candy CrushPremium
0755Pour WaterPremium
1756Design Most Recently Used QueuePremium
2061Number of Spaces Cleaning Robot CleanedPremium
2069Walking Robot Simulation II

Hard (10)

Hard problems
No.Problem
0068Text Justification
0749Contain Virus
1606Find Servers That Handled Most Number of Requests
2056Number of Valid Move Combinations On Chessboard
2296Design a Text Editor
2402Meeting Rooms III
2532Time to Cross a Bridge
2751Robot Collisions
0158Read N Characters Given read4 II - Call Multiple TimesPremium
2534Time Taken to Cross the DoorPremium

Eyes only

When the Simulation 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.