Pattern
Simulation
A compact view of archive entries grouped by recurring technique.
97 entries
97 entries tagged as Simulation.
14.04.2026
hard2463. Minimum Total Distance Traveled
Shortest distances to travel robots to factories
07.04.2026
medium2069. Walking Robot Simulation II
Implement perimeter-robot
06.04.2026
medium874. Walking Robot Simulation
Farthest robot movement
05.04.2026
easy657. Robot Return to Origin
R,L,U,D return to 0 in XY plane
03.04.2026
hard3661. Maximum Walls Destroyed by Robots
Max walls hit, each robot shoot left or right
02.04.2026
medium3418. Maximum Amount of Money Robot Can Earn
Max sum path, 2 skips allowed
01.04.2026
hard2751. Robot Collisions
Collide LR robots
27.03.2026
easy2946. Matrix Similarity After Cyclic Shifts
Shift rows k times left and right
26.02.2026
medium1404. Number of Steps to Reduce a Number in Binary Representation to One
Ops /2+1 to make 1
21.02.2026
easy762. Prime Number of Set Bits in Binary Representation
Number in l..r with prime bits count
18.02.2026
easy693. Binary Number with Alternating Bits
Alternating bits
14.02.2026
medium799. Champagne Tower
Flow in a Pascal's Triangle
22.01.2026
easy3507. Minimum Pair Removal to Sort Array I
Sort by removing lowest sum pairs
28.12.2025
easy1351. Count Negative Numbers in a Sorted Matrix
Count negatives in 2D sorted matrix
12.12.2025
medium3433. Count Mentions Per User
Count messages and track online users
19.11.2025
easy2154. Keep Multiplying Found Values by Two
First original=original 2 not in array
09.11.2025
easy2169. Count Operations to Obtain Zero
Count numbers subtractions until 0
28.10.2025
easy3354. Make Array Elements Equal to Zero
Places & directions that lead the simulation to all zeros
25.10.2025
easy1716. Calculate Money in Leetcode Bank
Add increasing sum of money, drop weekly gain on mondays
23.10.2025
easy3461. Check If Digits Are Equal in String After Operations I
Fold each pair to (a+b)%10 until 2 left
20.10.2025
easy2011. Final Value of Variable After Performing Operations
do ++ or -- operation from 0
13.10.2025
medium2273. Find Resultant Array After Removing Anagrams
Dedup anagrams
02.10.2025
medium3100. Water Bottles II
Total drinks with growing exchange rate empty for full
01.10.2025
easy1518. Water Bottles
Total drinks with exchange empty for full
30.09.2025
medium2221. Find Triangular Sum of an Array
Triangle sum % 10
16.09.2025
hard2197. Replace Non-Coprime Numbers in Array
Simulate gcd to lcm adjacent pair removal
10.09.2025
medium1733. Minimum Number of People to Teach
Min friends to teach common language to communicate in graph
09.09.2025
medium2327. Number of People Aware of a Secret
People knowing a secret at day n, keeping delay then spread and forget
08.09.2025
easy1317. Convert Integer to the Sum of Two No-Zero Integers
Find a+b=n without zeros in digits
10.08.2025
medium869. Reordered Power of 2
Rearrange digits to make power of two
5.08.2025
easy3477. Fruits Into Baskets II
Place fruits left to right to first available bucket
2.08.2025
hard2561. Rearranging Fruits
Min swaps cost to make a==b
12.07.2025
hard1900. The Earliest and Latest Rounds Where Players Compete
First and last round Alice fight Bob
11.07.2025
hard2402. Meeting Rooms III
Most frequent meeting room
3.07.2025
easy3304. Find the K-th Character in String Game I
kth char after appending rotated self
24.06.2025
easy2200. Find All K-Distant Indices in an Array
Indices k-distant to key
21.06.2025
medium3085. Minimum Deletions to Make String K-Special
Min remove to make frequencies k-narrow
15.06.2025
medium1432. Max Difference You Can Get From Changing an Integer
Max - min, replacing any digit, no leading zeros
06.06.2025
medium2434. Using a Robot to Print the Lexicographically Smallest String
Smallest string by writing to stack
03.06.2025
hard1298. Maximum Candies You Can Get from Boxes
Open boxes graph with keys simulation
13.05.2025
medium3335. Total Characters in String After Transformations I
String length after t shifts c=c+1,z=ab
02.05.2025
medium838. Push Dominoes
Dominoes simulation
18.04.2025
medium38. Count and Say
nth run-length encoded string
17.04.2025
easy2176. Count Equal and Divisible Pairs in an Array
Pairs a[i] == b[j], i j % k == 0
14.04.2025
easy1534. Count Good Triplets
Triplets with diff less than a,b,c
09.04.2025
easy3375. Minimum Operations to Make Array Values Equal to K
Count number bigger than k
08.04.2025
easy3396. Minimum Number of Operations to Make Elements in Array Distinct
Count removals 3-prefixes to deduplicate
27.03.2025
medium2780. Minimum Index of a Valid Split
Min split index to have equal majority elements
03.02.2025
easy3105. Longest Strictly Increasing or Strictly Decreasing Subarray
Longest strict monotonic subarray
23.01.2025
medium1267. Count Servers that Communicate
Connected servers by row or column
21.01.2025
medium2017. Grid Game
Maximum of minimized paths sum
07.01.2025
easy1408. String Matching in an Array
All substrings
18.12.2024
easy1475. Final Prices With a Special Discount in a Shop
Subtract next smaller value stack
16.12.2024
easy3264. Final Array State After K Multiplication Operations I
Mutliply k minimums
10.12.2024
medium2981. Find Longest Special Substring That Occurs Thrice I
Max same-char 3-windows length window
23.11.2024
medium1861. Rotating the Box
Rotate matrix and simulate the fall
18.11.2024
easy1652. Defuse the Bomb
Next +-k window sums window
03.11.2024
easy796. Rotate String
Is string rotated goal?
14.10.2024
medium2530. Maximal Score After Applying K Operations
Replace max(arr) with ceil(max/3) k times
09.09.2024
medium2326. Spiral Matrix IV
LinkedList to spiral 2D matrix list
04.09.2024
medium874. Walking Robot Simulation
Max distance after robot moves simulation
03.09.2024
easy1945. Sum of Digits of String After Convert
Sum of number chars k times
15.08.2024
easy860. Lemonade Change
Simulate money exchange
13.08.2024
medium40. Combination Sum II
Unique target sum subsequences
11.08.2024
hard1568. Minimum Number of Days to Disconnect Island
Min changes 1 to 0 to disconnect islands
08.08.2024
medium885. Spiral Matrix III
D spiraling order
13.07.2024
hard2751. Robot Collisions
D dimensional robots fight
11.07.2024
medium1190. Reverse Substrings Between Each Pair of Parentheses
Reverse string in parentheses recursively
10.07.2024
easy1598. Crawler Log Folder
Filesystem path depth
9.07.2024
medium1701. Average Waiting Time
Average of intersecting intervals
8.07.2024
medium1823. Find the Winner of the Circular Game
Last of k-th excluded from 1..n
7.07.2024
easy1518. Water Bottles
Bottles drink and exchange simulation
6.07.2024
easy2582. Pass the Pillow
Loop position in increasing-decreasing array
17.06.2024
medium633. Sum of Square Numbers
Is c sum of squares? search
27.05.2024
easy1608. Special Array With X Elements Greater Than or Equal X
Count of more or equal nums[i] equal itself
08.04.2024
easy1700. Number of Students Unable to Eat Lunch
First sandwitch not eaten by any while popped from a queue
03.02.2024
medium1043. Partition Array for Maximum Sum
Max sum of partition array into chunks size of at most k filled with max value in chunk.
25.01.2024
medium1143. Longest Common Subsequence
Longest common subsequence of two strings.
18.01.2024
easy70. Climbing Stairs
Ways to climb n stairs by 1 or 2 steps.
23.12.2023
easy1496. Path Crossing
Is path string of 'N', 'E', 'W', 'S' crosses
05.11.2023
medium1535. Find the Winner of an Array Game
Find maximum of the k nearest in array
03.11.2023
medium767. Reorganize String
Non-repeating consequent chars string from another string
15.10.2023
hard1269. Number of Ways to Stay in the Same Place After Some Steps
Number of ways to return to 0 after moving left, right or stay steps time
13.10.2023
easy746. Min Cost Climbing Stairs
Classic DP: climbing stairs
26.09.2023
medium316. Remove Duplicate Letters
Lexicographical smallest subsequence without duplicates
12.08.2023
medium63. Unique Paths II
Number of right-down ways tl->br in a matrix with obstacles
02.08.2023
medium46. Permutations
List of all numbers permutations
22.07.2023
medium688. Knight Probability in Chessboard
Probability of making k steps on a chessboard without stepping outside
10.05.2023
medium59. Spiral Matrix II
to detect an empty cell, we can check it for == 0
9.05.2023
medium54. Spiral Matrix
do track the borders left, top, right, bottom
4.05.2023
medium649. Dota2 Senate
Use Queue and count how many bans are from the Radiant and from the Dire.
24.04.2023
easy1046. Last Stone Weight
use PriorityQueue with compareByDescending
13.04.2023
medium946. Validate Stack Sequences
use one iteration and a second pointer for pop
12.04.2023
medium71. Simplify Path
split the string by /
07.03.2023
medium2187. Minimum Time to Complete Trips
Do a binary search. For the hi value, we can peak a $$10^7$$ or just compute all the time it takes for every bus to trip.
3.02.2023
medium6. Zigzag Conversion
Store simulation result in a [rowsNum][simulation indice] - matrix, then build the result.
8.11.2022
easyMake The String Great
The simplest solution is just to simulate all the process, as input string is just 100 symbols.