Tags

Simulation

Simulation

0 lessons
8 problems
1 community item

simulation

Practice Problems

8 problems

Last Stone Weight

Free
Not Started
Easy

Simulate smashing the two heaviest stones together repeatedly using a max-heap and return the weight of the last remaining stone.

Heap
Max Heap
Priority Queue
Simulation
Beginner

187

5

Text Justification

Not Started
Hard

Given an array of words and a maximum width, format the text so that each line has exactly the specified number of characters, fully justified (left and right).

Strings
Simulation
Greedy
Advanced

798

12

Game of Life

Not Started
Medium

Implement Conway's Game of Life: compute the next state of a board in-place using state-encoding to avoid extra space.

Arrays
Matrix Algorithms
Matrix Traversal
Simulation
In-Place
Intermediate

489

5

Multiply Strings

Not Started
Medium

Given two non-negative integers represented as strings, return their product as a string. You must not convert the inputs to integers directly or use any built-in BigInteger library.

Mathematics
Strings
Simulation
Algorithms
Intermediate

1k

27

Snakes and Ladders

Not Started
Medium

Given a Snakes and Ladders board, find the minimum number of dice rolls to reach the final square from square 1.

Graphs
BFS
Shortest Path
Simulation
Intermediate

920

27

Spiral Matrix

Free
Not Started
Medium

Return all elements of an m x n matrix in spiral order, traversing from the outer boundary inward.

Arrays
Matrix Algorithms
Matrix Traversal
Spiral Order
Simulation
Intermediate

364

10

String to Integer (atoi)

Not Started
Medium

Implement the myAtoi(string s) function, which converts a string to a 32-bit signed integer. Handle leading whitespace, optional sign, digit parsing, and integer overflow/underflow.

Strings
Mathematics
State Machine
Simulation
Algorithms
Intermediate

231

7

Zigzag Conversion

Not Started
Medium

Convert a string to a zigzag pattern across a given number of rows, then read it line by line.

Strings
Simulation
Intermediate

916

30