Simulation Problems
Master simulation problems with AI-powered solutions. Get instant coding assistance during your technical interviews for all 132 problems in this category.
Total Problems: 132
Easy: 56
Medium: 68
Hard: 8
Showing 50 of 132 problems
Problems
Scroll within this area to browse all problems
#
Title
Difficulty
Simulation LeetCode Problems List
- 412. Fizz Buzz - Easy - SimulationGiven an integer n, return a string array answer (1-indexed) where: answer[i] == "FizzBuzz" if i is divisible by 3 and 5. answer[i] == "Fizz" if i is ... Topics: Math, String, Simulation
- 54. Spiral Matrix - Medium - SimulationGiven an m x n matrix, return all elements of the matrix in spiral order.... Topics: Array, Matrix, Simulation
- 898. Transpose Matrix - Easy - SimulationGiven a 2D integer array matrix, return the transpose of matrix. The transpose of a matrix is the matrix flipped over its main diagonal, switching the... Topics: Array, Matrix, Simulation
- 289. Game of Life - Medium - SimulationAccording to Wikipedia's article: "The Game of Life, also known simply as Life, is a cellular automaton devised by the British mathematician John Hort... Topics: Array, Matrix, Simulation
- 67. Add Binary - Easy - SimulationGiven two binary strings a and b, return their sum as a binary string.... Topics: Math, String, Bit Manipulation, Simulation
- 43. Multiply Strings - Medium - SimulationGiven two non-negative integers num1 and num2 represented as strings, return the product of num1 and num2, also represented as a string. Note: You mus... Topics: Math, String, Simulation
- 68. Text Justification - Hard - SimulationGiven an array of strings words and a width maxWidth, format the text such that each line has exactly maxWidth characters and is fully (left and right... Topics: Array, String, Simulation
- 2479. Meeting Rooms III - Hard - SimulationYou are given an integer n. There are n rooms numbered from 0 to n - 1. You are given a 2D integer array meetings where meetings[i] = [starti, endi] m... Topics: Array, Hash Table, Sorting, Heap (Priority Queue), Simulation
- 735. Asteroid Collision - Medium - SimulationWe are given an array asteroids of integers representing asteroids in a row. The indices of the asteriod in the array represent their relative positio... Topics: Array, Stack, Simulation
- 1708. Design Parking System - Easy - SimulationDesign a parking system for a parking lot. The parking lot has three kinds of parking spaces: big, medium, and small, with a fixed number of slots for... Topics: Design, Simulation, Counting
- 2021. Remove All Occurrences of a Substring - Medium - SimulationGiven two strings s and part, perform the following operation on s until all occurrences of the substring part are removed: Find the leftmost occurren... Topics: String, Stack, Simulation
- 1119. Robot Bounded In Circle - Medium - SimulationOn an infinite plane, a robot initially stands at (0, 0) and faces north. Note that: The north direction is the positive direction of the y-axis. The ... Topics: Math, String, Simulation
- 640. Solve the Equation - Medium - SimulationSolve a given equation and return the value of 'x' in the form of a string "x=#value". The equation contains only '+', '-' operation, the variable 'x'... Topics: Math, String, Simulation
- 861. Flipping an Image - Easy - SimulationGiven an n x n binary matrix image, flip the image horizontally, then invert it, and return the resulting image. To flip an image horizontally means t... Topics: Array, Two Pointers, Bit Manipulation, Matrix, Simulation
- 59. Spiral Matrix II - Medium - SimulationGiven a positive integer n, generate an n x n matrix filled with elements from 1 to n2 in spiral order.... Topics: Array, Matrix, Simulation
- 3790. Fruits Into Baskets II - Easy - SimulationYou are given two arrays of integers, fruits and baskets, each of length n, where fruits[i] represents the quantity of the ith type of fruit, and bask... Topics: Array, Binary Search, Segment Tree, Simulation, Ordered Set
- 2411. Spiral Matrix IV - Medium - SimulationYou are given two integers m and n, which represent the dimensions of a matrix. You are also given the head of a linked list of integers. Generate an ... Topics: Array, Linked List, Matrix, Simulation
- 921. Spiral Matrix III - Medium - SimulationYou start at the cell (rStart, cStart) of an rows x cols grid facing east. The northwest corner is at the first row and column in the grid, and the so... Topics: Array, Matrix, Simulation
- 2278. Find Three Consecutive Integers That Sum to a Given Number - Medium - SimulationGiven an integer num, return three consecutive integers (as a sorted array) that sum to num. If num cannot be expressed as the sum of three consecutiv... Topics: Math, Simulation
- 874. Backspace String Compare - Easy - SimulationGiven two strings s and t, return true if they are equal when both are typed into empty text editors. '#' means a backspace character. Note that after... Topics: Two Pointers, String, Stack, Simulation
- 592. Fraction Addition and Subtraction - Medium - SimulationGiven a string expression representing an expression of fraction addition and subtraction, return the calculation result in string format. The final r... Topics: Math, String, Simulation
- 1184. Car Pooling - Medium - SimulationThere is a car with capacity empty seats. The vehicle only drives east (i.e., it cannot turn around and drive west). You are given the integer capacit... Topics: Array, Sorting, Heap (Priority Queue), Simulation, Prefix Sum
- 682. Baseball Game - Easy - SimulationYou are keeping the scores for a baseball game with strange rules. At the beginning of the game, you start with an empty record. You are given a list ... Topics: Array, Stack, Simulation
- 2428. Equal Row and Column Pairs - Medium - SimulationGiven a 0-indexed n x n integer matrix grid, return the number of pairs (ri, cj) such that row ri and column cj are equal. A row and column pair is co... Topics: Array, Hash Table, Matrix, Simulation
- 1400. Find Winner on a Tic Tac Toe Game - Easy - SimulationTic-tac-toe is played by two players A and B on a 3 x 3 grid. The rules of Tic-Tac-Toe are: Players take turns placing characters into empty squares '... Topics: Array, Hash Table, Matrix, Simulation
- 415. Add Strings - Easy - SimulationGiven two non-negative integers, num1 and num2 represented as string, return the sum of num1 and num2 as a string. You must solve the problem without ... Topics: Math, String, Simulation
- 1310. Watering Plants - Medium - SimulationYou want to water n plants in your garden with a watering can. The plants are arranged in a row and are labeled from 0 to n - 1 from left to right whe... Topics: Array, Simulation
- 2169. Simple Bank System - Medium - SimulationYou have been tasked with writing a program for a popular bank that will automate all its incoming transactions (transfer, deposit, and withdraw). The... Topics: Array, Hash Table, Design, Simulation
- 498. Diagonal Traverse - Medium - SimulationGiven an m x n matrix mat, return an array of all the elements of the array in a diagonal order.... Topics: Array, Matrix, Simulation
- 906. Walking Robot Simulation - Medium - SimulationA robot on an infinite XY-plane starts at point (0, 0) facing north. The robot receives an array of integers commands, which represents a sequence of ... Topics: Array, Hash Table, Simulation
- 2662. Check Knight Tour Configuration - Medium - SimulationThere is a knight on an n x n chessboard. In a valid configuration, the knight starts at the top-left cell of the board and visits every cell on the b... Topics: Array, Depth-First Search, Breadth-First Search, Matrix, Simulation
- 2483. Task Scheduler II - Medium - SimulationYou are given a 0-indexed array of positive integers tasks, representing tasks that need to be completed in order, where tasks[i] represents the type ... Topics: Array, Hash Table, Simulation
- 258. Add Digits - Easy - SimulationGiven an integer num, repeatedly add all its digits until the result has only one digit, and return it.... Topics: Math, Simulation, Number Theory
- 1803. Average Waiting Time - Medium - SimulationThere is a restaurant with a single chef. You are given an array customers, where customers[i] = [arrivali, timei]: arrivali is the arrival time of th... Topics: Array, Simulation
- 1505. Create Target Array in the Given Order - Easy - SimulationGiven two arrays of integers nums and index. Your task is to create target array under the following rules: Initially target array is empty. From left... Topics: Array, Simulation
- 2260. Divide a String Into Groups of Size k - Easy - SimulationA string s can be partitioned into groups of size k using the following procedure: The first group consists of the first k characters of the string, t... Topics: String, Simulation
- 987. Reveal Cards In Increasing Order - Medium - SimulationYou are given an integer array deck. There is a deck of cards where every card has a unique integer. The integer on the ith card is deck[i]. You can o... Topics: Array, Queue, Sorting, Simulation
- 2679. Count Distinct Numbers on Board - Easy - SimulationYou are given a positive integer n, that is initially placed on a board. Every day, for 109 days, you perform the following procedure: For each number... Topics: Array, Hash Table, Math, Simulation
- 1642. Water Bottles - Easy - SimulationThere are numBottles water bottles that are initially full of water. You can exchange numExchange empty water bottles from the market with one full wa... Topics: Math, Simulation
- 3426. Minimum Number of Chairs in a Waiting Room - Easy - SimulationYou are given a string s. Simulate events at each second i: If s[i] == 'E', a person enters the waiting room and takes one of the chairs in it. If s[i... Topics: String, Simulation
- 2271. Rearrange Array Elements by Sign - Medium - SimulationYou are given a 0-indexed integer array nums of even length consisting of an equal number of positive and negative integers. You should return the arr... Topics: Array, Two Pointers, Simulation
- 2048. Build Array from Permutation - Easy - SimulationGiven a zero-based permutation nums (0-indexed), build an array ans of the same length where ans[i] = nums[nums[i]] for each 0 <= i < nums.length and ... Topics: Array, Simulation
- 3708. Zigzag Grid Traversal With Skip - Easy - SimulationYou are given an m x n 2D array grid of positive integers. Your task is to traverse grid in a zigzag pattern while skipping every alternate cell. Zigz... Topics: Array, Matrix, Simulation
- 2317. Count Collisions on a Road - Medium - SimulationThere are n cars on an infinitely long road. The cars are numbered from 0 to n - 1 from left to right and each car is present at a unique point. You a... Topics: String, Stack, Simulation
- 566. Reshape the Matrix - Easy - SimulationIn MATLAB, there is a handy function called reshape which can reshape an m x n matrix into a new one with a different size r x c keeping its original ... Topics: Array, Matrix, Simulation
- 2298. Count Integers With Even Digit Sum - Easy - SimulationGiven a positive integer num, return the number of positive integers less than or equal to num whose digit sums are even. The digit sum of a positive ... Topics: Math, Simulation
- 1324. Where Will the Ball Fall - Medium - SimulationYou have a 2-D grid of size m x n representing a box, and you have n balls. The box is open on the top and bottom sides. Each cell in the box has a di... Topics: Array, Matrix, Simulation
- 2137. Final Value of Variable After Performing Operations - Easy - SimulationThere is a programming language with only four operations and one variable X: ++X and X++ increments the value of the variable X by 1. --X and X-- dec... Topics: Array, String, Simulation
- 537. Complex Number Multiplication - Medium - SimulationA complex number can be represented as a string on the form "real+imaginaryi" where: real is the real part and is an integer in the range [-100, 100].... Topics: Math, String, Simulation
- 1971. Incremental Memory Leak - Medium - SimulationYou are given two integers memory1 and memory2 representing the available memory in bits on two memory sticks. There is currently a faulty program run... Topics: Math, Simulation
- 657. Robot Return to Origin - Easy - SimulationThere is a robot starting at the position (0, 0), the origin, on a 2D plane. Given a sequence of its moves, judge if this robot ends up at (0, 0) afte... Topics: String, Simulation
- 1027. Sum of Even Numbers After Queries - Medium - SimulationYou are given an integer array nums and an array queries where queries[i] = [vali, indexi]. For each query i, first, apply nums[indexi] = nums[indexi]... Topics: Array, Simulation
- 2606. Difference Between Ones and Zeros in Row and Column - Medium - SimulationYou are given a 0-indexed m x n binary matrix grid. A 0-indexed m x n difference matrix diff is created with the following procedure: Let the number o... Topics: Array, Matrix, Simulation
- 1802. Number of Students Unable to Eat Lunch - Easy - SimulationThe school cafeteria offers circular and square sandwiches at lunch break, referred to by numbers 0 and 1 respectively. All students stand in a queue.... Topics: Array, Stack, Queue, Simulation
- 1342. Queens That Can Attack the King - Medium - SimulationOn a 0-indexed 8 x 8 chessboard, there can be multiple black queens and one white king. You are given a 2D integer array queens where queens[i] = [xQu... Topics: Array, Matrix, Simulation
- 2389. Design a Text Editor - Hard - SimulationDesign a text editor with a cursor that can do the following: Add text to where the cursor is. Delete text from where the cursor is (simulating the ba... Topics: Linked List, String, Stack, Design, Simulation, Doubly-Linked List
- 2386. Min Max Game - Easy - SimulationYou are given a 0-indexed integer array nums whose length is a power of 2. Apply the following algorithm on nums: Let n be the length of nums. If n ==... Topics: Array, Simulation
- 1951. Find the Winner of the Circular Game - Medium - SimulationThere are n friends that are playing a game. The friends are sitting in a circle and are numbered from 1 to n in clockwise order. More formally, movin... Topics: Array, Math, Recursion, Queue, Simulation
- 983. Validate Stack Sequences - Medium - SimulationGiven two integer arrays pushed and popped each with distinct values, return true if this could have been the result of a sequence of push and pop ope... Topics: Array, Stack, Simulation
- 2058. Concatenation of Array - Easy - SimulationGiven an integer array nums of length n, you want to create an array ans of length 2n where ans[i] == nums[i] and ans[i + n] == nums[i] for 0 <= i < n... Topics: Array, Simulation
- 1552. Build an Array With Stack Operations - Medium - SimulationYou are given an integer array target and an integer n. You have an empty stack with the two following operations: "Push": pushes an integer to the to... Topics: Array, Stack, Simulation
- 2195. Time Needed to Buy Tickets - Easy - SimulationThere are n people in a line queuing to buy tickets, where the 0th person is at the front of the line and the (n - 1)th person is at the back of the l... Topics: Array, Queue, Simulation
- 3905. Partition String - Medium - SimulationGiven a string s, partition it into unique segments according to the following procedure: Start building a segment beginning at index 0. Continue exte... Topics: Hash Table, String, Trie, Simulation
- 3413. Find The First Player to win K Games in a Row - Medium - SimulationA competition consists of n players numbered from 0 to n - 1. You are given an integer array skills of size n and a positive integer k, where skills[i... Topics: Array, Simulation
- 2551. Apply Operations to an Array - Easy - SimulationYou are given a 0-indexed array nums of size n consisting of non-negative integers. You need to apply n - 1 operations to this array where, in the ith... Topics: Array, Two Pointers, Simulation
- 1667. Find Kth Bit in Nth Binary String - Medium - SimulationGiven two positive integers n and k, the binary string Sn is formed as follows: S1 = "0" Si = Si - 1 + "1" + reverse(invert(Si - 1)) for i > 1 Where +... Topics: String, Recursion, Simulation
- 3511. Find the Winning Player in Coin Game - Easy - SimulationYou are given two positive integers x and y, denoting the number of coins with values 75 and 10 respectively. Alice and Bob are playing a game. Each t... Topics: Math, Simulation, Game Theory
- 2470. Removing Stars From a String - Medium - SimulationYou are given a string s, which contains stars *. In one operation, you can: Choose a star in s. Remove the closest non-star character to its left, as... Topics: String, Stack, Simulation
- 2265. Partition Array According to Given Pivot - Medium - SimulationYou are given a 0-indexed integer array nums and an integer pivot. Rearrange nums such that the following conditions are satisfied: Every element less... Topics: Array, Two Pointers, Simulation
- 3931. Process String with Special Operations I - Medium - SimulationYou are given a string s consisting of lowercase English letters and the special characters: *, #, and %. Build a new string result by processing s ac... Topics: String, Simulation
- 3939. Process String with Special Operations II - Hard - SimulationYou are given a string s consisting of lowercase English letters and the special characters: '*', '#', and '%'. You are also given an integer k. Build... Topics: String, Simulation
- 1928. Number of Orders in the Backlog - Medium - SimulationYou are given a 2D integer array orders, where each orders[i] = [pricei, amounti, orderTypei] denotes that amounti orders have been placed of type ord... Topics: Array, Heap (Priority Queue), Simulation
- 3540. Hash Divided String - Medium - SimulationYou are given a string s of length n and an integer k, where n is a multiple of k. Your task is to hash the string s into a new string called result, ... Topics: String, Simulation
- 2166. Number of Valid Move Combinations On Chessboard - Hard - SimulationThere is an 8 x 8 chessboard containing n pieces (rooks, queens, or bishops). You are given a string array pieces of length n, where pieces[i] describ... Topics: Array, String, Backtracking, Simulation
- 2857. Total Distance Traveled - Easy - SimulationA truck has two fuel tanks. You are given two integers, mainTank representing the fuel present in the main tank in liters and additionalTank represent... Topics: Math, Simulation
- 2197. Decode the Slanted Ciphertext - Medium - SimulationA string originalText is encoded using a slanted transposition cipher to a string encodedText with the help of a matrix having a fixed number of rows ... Topics: String, Simulation
- 3600. Find the K-th Character in String Game I - Easy - SimulationAlice and Bob are playing a game. Initially, Alice has a string word = "a". You are given a positive integer k. Now Bob will ask Alice to perform the ... Topics: Math, Bit Manipulation, Recursion, Simulation
- 2232. Adding Spaces to a String - Medium - SimulationYou are given a 0-indexed string s and a 0-indexed integer array spaces that describes the indices in the original string where spaces will be added. ... Topics: Array, Two Pointers, String, Simulation
- 2800. Minimum String Length After Removing Substrings - Easy - SimulationYou are given a string s consisting only of uppercase English letters. You can apply some operations to this string where, in one operation, you can r... Topics: String, Stack, Simulation
- 2299. Merge Nodes in Between Zeros - Medium - SimulationYou are given the head of a linked list, which contains a series of integers separated by 0's. The beginning and end of the linked list will have Node... Topics: Linked List, Simulation
- 1520. Number of Steps to Reduce a Number in Binary Representation to One - Medium - SimulationGiven the binary representation of an integer as a string s, return the number of steps to reduce it to 1 under the following rules: If the current nu... Topics: String, Bit Manipulation, Simulation
- 3336. Water Bottles II - Medium - SimulationYou are given two integers numBottles and numExchange. numBottles represents the number of full water bottles that you initially have. In one operatio... Topics: Math, Simulation
- 3794. Find the Minimum Amount of Time to Brew Potions - Medium - SimulationYou are given two integer arrays, skill and mana, of length n and m, respectively. In a laboratory, n wizards must brew m potions in order. Each potio... Topics: Array, Simulation, Prefix Sum
- 2361. Calculate Digit Sum of a String - Easy - SimulationYou are given a string s consisting of digits and an integer k. A round can be completed if the length of s is greater than k. In one round, do the fo... Topics: String, Simulation
- 3434. Find the Number of Distinct Colors Among the Balls - Medium - SimulationYou are given an integer limit and a 2D array queries of size n x 2. There are limit + 1 balls with distinct labels in the range [0, limit]. Initially... Topics: Array, Hash Table, Simulation
- 2642. Time to Cross a Bridge - Hard - SimulationThere are k workers who want to move n boxes from the right (old) warehouse to the left (new) warehouse. You are given the two integers n and k, and a... Topics: Array, Heap (Priority Queue), Simulation
- 1657. Find the Winner of an Array Game - Medium - SimulationGiven an integer array arr of distinct integers and an integer k. A game will be played between the first two elements of the array (i.e. arr[0] and a... Topics: Array, Simulation
- 2324. Find Triangular Sum of an Array - Medium - SimulationYou are given a 0-indexed integer array nums, where nums[i] is a digit between 0 and 9 (inclusive). The triangular sum of nums is the value of the onl... Topics: Array, Math, Simulation, Combinatorics
- 2239. Execution of All Suffix Instructions Staying in a Grid - Medium - SimulationThere is an n x n grid, with the top-left cell at (0, 0) and the bottom-right cell at (n - 1, n - 1). You are given the integer n and an integer array... Topics: String, Simulation
- 2834. Relocate Marbles - Medium - SimulationYou are given a 0-indexed integer array nums representing the initial positions of some marbles. You are also given two 0-indexed integer arrays moveF... Topics: Array, Hash Table, Sorting, Simulation
- 3450. Find the Child Who Has the Ball After K Seconds - Easy - SimulationYou are given two positive integers n and k. There are n children numbered from 0 to n - 1 standing in a queue in order from left to right. Initially,... Topics: Math, Simulation
- 3215. Matrix Similarity After Cyclic Shifts - Easy - SimulationYou are given an m x n integer matrix mat and an integer k. The matrix rows are 0-indexed. The following proccess happens k times: Even-indexed rows (... Topics: Array, Math, Matrix, Simulation
- 3634. Find Mirror Score of a String - Medium - SimulationYou are given a string s. We define the mirror of a letter in the English alphabet as its corresponding letter when the alphabet is reversed. For exam... Topics: Hash Table, String, Stack, Simulation
- 1806. Count of Matches in Tournament - Easy - SimulationYou are given an integer n, the number of teams in a tournament that has strange rules: If the current number of teams is even, each team gets paired ... Topics: Math, Simulation
- 1627. Last Moment Before All Ants Fall Out of a Plank - Medium - SimulationWe have a wooden plank of the length n units. Some ants are walking on the plank, each ant moves with a speed of 1 unit per second. Some of the ants m... Topics: Array, Brainteaser, Simulation
- 3226. Minimum Number Game - Easy - SimulationYou are given a 0-indexed integer array nums of even length and there is also an empty array arr. Alice and Bob decided to play a game where in every ... Topics: Array, Sorting, Heap (Priority Queue), Simulation
- 2436. Make Array Zero by Subtracting Equal Amounts - Easy - SimulationYou are given a non-negative integer array nums. In one operation, you must: Choose a positive integer x such that x is less than or equal to the smal... Topics: Array, Hash Table, Greedy, Sorting, Heap (Priority Queue), Simulation
- 3447. Clear Digits - Easy - SimulationYou are given a string s. Your task is to remove all digits by doing this operation repeatedly: Delete the first digit and the closest non-digit chara... Topics: String, Stack, Simulation
- 2076. Sum of Digits of String After Convert - Easy - SimulationYou are given a string s consisting of lowercase English letters, and an integer k. Your task is to convert the string into an integer by a special pr... Topics: String, Simulation
- 1721. Maximum Profit of Operating a Centennial Wheel - Medium - SimulationYou are the operator of a Centennial Wheel that has four gondolas, and each gondola has room for up to four people. You have the ability to rotate the... Topics: Array, Simulation
- 2639. Separate the Digits in an Array - Easy - SimulationGiven an array of positive integers nums, return an array answer that consists of the digits of each integer in nums after separating them in the same... Topics: Array, Simulation
- 1449. Print Words Vertically - Medium - SimulationGiven a string s. Return all the words vertically in the same order in which they appear in s. Words are returned as a list of strings, complete with ... Topics: Array, String, Simulation
- 1682. Most Visited Sector in a Circular Track - Easy - SimulationGiven an integer n and an integer array rounds. We have a circular track which consists of n sectors labeled from 1 to n. A marathon will be held on t... Topics: Array, Simulation
- 1195. Distribute Candies to People - Easy - SimulationWe distribute some number of candies, to a row of n = num_people people in the following way: We then give 1 candy to the first person, 2 candies to t... Topics: Math, Simulation
- 3893. Generate Tag for Video Caption - Easy - SimulationYou are given a string caption representing the caption for a video. The following actions must be performed in order to generate a valid tag for the ... Topics: String, Simulation
- 2846. Robot Collisions - Hard - SimulationThere are n 1-indexed robots, each having a position on a line, health, and movement direction. You are given 0-indexed integer arrays positions, heal... Topics: Array, Stack, Sorting, Simulation
- 3311. Ant on the Boundary - Easy - SimulationAn ant is on a boundary. It sometimes goes left and sometimes right. You are given an array of non-zero integers nums. The ant starts reading nums fro... Topics: Array, Simulation, Prefix Sum
- 3860. Resulting String After Adjacent Removals - Medium - SimulationYou are given a string s consisting of lowercase English letters. You must repeatedly perform the following operation while the string s has at least ... Topics: String, Stack, Simulation
- 2132. Convert 1D Array Into 2D Array - Easy - SimulationYou are given a 0-indexed 1-dimensional (1D) integer array original, and two integers, m and n. You are tasked with creating a 2-dimensional (2D) arra... Topics: Array, Matrix, Simulation
- 2585. Delete Greatest Value in Each Row - Easy - SimulationYou are given an m x n matrix grid consisting of positive integers. Perform the following operation until grid becomes empty: Delete the element with ... Topics: Array, Sorting, Heap (Priority Queue), Matrix, Simulation
- 750. Contain Virus - Hard - SimulationA virus is spreading rapidly, and your task is to quarantine the infected area by installing walls. The world is modeled as an m x n binary grid isInf... Topics: Array, Depth-First Search, Breadth-First Search, Matrix, Simulation
- 3566. Find the Sequence of Strings Appeared on the Screen - Medium - SimulationYou are given a string target. Alice is going to type target on her computer using a special keyboard that has only two keys: Key 1 appends the charac... Topics: String, Simulation
- 2006. Find the Student that Will Replace the Chalk - Medium - SimulationThere are n students in a class numbered from 0 to n - 1. The teacher will give each student a problem starting with the student number 0, then the st... Topics: Array, Binary Search, Simulation, Prefix Sum
- 495. Teemo Attacking - Easy - SimulationOur hero Teemo is attacking an enemy Ashe with poison attacks! When Teemo attacks Ashe, Ashe gets poisoned for a exactly duration seconds. More formal... Topics: Array, Simulation
- 1041. Available Captures for Rook - Easy - SimulationYou are given an 8 x 8 matrix representing a chessboard. There is exactly one white rook represented by 'R', some number of white bishops 'B', and som... Topics: Array, Matrix, Simulation
- 2553. Total Cost to Hire K Workers - Medium - SimulationYou are given a 0-indexed integer array costs where costs[i] is the cost of hiring the ith worker. You are also given two integers k and candidates. W... Topics: Array, Two Pointers, Heap (Priority Queue), Simulation
- 1386. Shift 2D Grid - Easy - SimulationGiven a 2D grid of size m x n and an integer k. You need to shift the grid k times. In one shift operation: Element at grid[i][j] moves to grid[i][j +... Topics: Array, Matrix, Simulation
- 3732. Calculate Score After Performing Instructions - Medium - SimulationYou are given two arrays, instructions and values, both of size n. You need to simulate a process based on the following rules: You start at the first... Topics: Array, Hash Table, String, Simulation
- 2645. Pass the Pillow - Easy - SimulationThere are n people standing in a line labeled from 1 to n. The first person in the line is holding a pillow initially. Every second, the person holdin... Topics: Math, Simulation
- 2155. Find Missing Observations - Medium - SimulationYou have observations of n + m 6-sided dice rolls with each face numbered from 1 to 6. n of the observations went missing, and you only have the obser... Topics: Array, Math, Simulation
- 2274. Keep Multiplying Found Values by Two - Easy - SimulationYou are given an array of integers nums. You are also given an integer original which is the first number that needs to be searched for in nums. You t... Topics: Array, Hash Table, Sorting, Simulation
- 2684. Determine the Winner of a Bowling Game - Easy - SimulationYou are given two 0-indexed integer arrays player1 and player2, representing the number of pins that player 1 and player 2 hit in a bowling game, resp... Topics: Array, Simulation
- 2692. Take Gifts From the Richest Pile - Easy - SimulationYou are given an integer array gifts denoting the number of gifts in various piles. Every second, you do the following: Choose the pile with the maxim... Topics: Array, Heap (Priority Queue), Simulation
- 3332. Minimum Operations to Exceed Threshold Value II - Medium - SimulationYou are given a 0-indexed integer array nums, and an integer k. You are allowed to perform some operations on nums, where in a single operation, you c... Topics: Array, Heap (Priority Queue), Simulation
- 2388. Replace Elements in an Array - Medium - SimulationYou are given a 0-indexed array nums that consists of n distinct positive integers. Apply m operations to this array, where in the ith operation you r... Topics: Array, Hash Table, Simulation
- 2587. Design Memory Allocator - Medium - SimulationYou are given an integer n representing the size of a 0-indexed memory array. All memory units are initially free. You have a memory allocator with th... Topics: Array, Hash Table, Design, Simulation
- 1048. Clumsy Factorial - Medium - SimulationThe factorial of a positive integer n is the product of all positive integers less than or equal to n. For example, factorial(10) = 10 * 9 * 8 * 7 * 6... Topics: Math, Stack, Simulation
- 2728. Sum in a Matrix - Medium - SimulationYou are given a 0-indexed 2D integer array nums. Initially, your score is 0. Perform the following operations until the matrix becomes empty: From eac... Topics: Array, Sorting, Heap (Priority Queue), Matrix, Simulation
- 2886. Faulty Keyboard - Easy - SimulationYour laptop keyboard is faulty, and whenever you type a character 'i' on it, it reverses the string that you have written. Typing other characters wor... Topics: String, Simulation
- 2288. Count Operations to Obtain Zero - Easy - SimulationYou are given two non-negative integers num1 and num2. In one operation, if num1 >= num2, you must subtract num2 from num1, otherwise subtract num1 fr... Topics: Math, Simulation
- 2228. Watering Plants II - Medium - SimulationAlice and Bob want to water n plants in their garden. The plants are arranged in a row and are labeled from 0 to n - 1 from left to right where the it... Topics: Array, Two Pointers, Simulation
- 1769. Get Maximum in Generated Array - Easy - SimulationYou are given an integer n. A 0-indexed integer array nums of length n + 1 is generated in the following way: nums[0] = 0 nums[1] = 1 nums[2 * i] = nu... Topics: Array, Simulation
Related LeetCode Topics
- Array LeetCode Problems
- Backtracking LeetCode Problems
- Biconnected Component LeetCode Problems
- Binary Indexed Tree LeetCode Problems
- Binary Search LeetCode Problems
- Binary Search Tree LeetCode Problems
- Binary Tree LeetCode Problems
- Bit Manipulation LeetCode Problems
- Bitmask LeetCode Problems
- Brainteaser LeetCode Problems
- Breadth-First Search LeetCode Problems
- Bucket Sort LeetCode Problems
- Combinatorics LeetCode Problems
- Concurrency LeetCode Problems
- Counting LeetCode Problems
- Counting Sort LeetCode Problems
- Data Stream LeetCode Problems
- Database LeetCode Problems
- Depth-First Search LeetCode Problems
- Design LeetCode Problems