simulation
LeetCode / Simulation / 1706번 / Where Will the Ball Fall / JS
Where Will the Ball Fall - LeetCode Can you solve this real interview question? Where Will the Ball Fall - You 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 diagonal board spanning two corners o leetcode.com 문제에 있는 그림대로 공이 이동했을 경우 각 열마다의 공이 몇번째 열로 마지막에 나오는지 반환하는 문제이다. 만약 중간에 ..
LeetCode / Simulation / 54번 / Spiral Matrix / JS
Spiral Matrix - LeetCode Can you solve this real interview question? Spiral Matrix - Given an m x n matrix, return all elements of the matrix in spiral order. Example 1: [https://assets.leetcode.com/uploads/2020/11/13/spiral1.jpg] Input: matrix = [[1,2,3],[4,5,6],[7,8,9]] Outpu leetcode.com 위와 같은 규칙을 가지면서 이동할 때, 이동한 순서를 담긴 배열을 반환한다. /** * @param {number[][]} matrix * @ret..