Find Zero Cells in a 2×2 Grid
Updated
Problem statement
You are given an integer grid with exactly two rows and two columns. Find every cell whose value equals 0.
For this exercise, assume the result contains zero-based coordinate pairs [row, column], ordered by increasing row and then increasing column. Return an empty array when the grid contains no zeros. Inspect cells independently; neighboring zeros still produce separate coordinate pairs.
Function
findZeroCells(grid: int[][]) → int[][]Examples
Example 1
grid = [[0,4],[3,0]]return = [[0,0],[1,1]]Moved or new
The zero cells are the top-left and bottom-right cells.
Example 2
grid = [[5,1],[9,2]]return = []Every value is nonzero, so the result is empty.
Example 3
grid = [[0,0],[0,0]]return = [[0,0],[0,1],[1,0],[1,1]]All four cells are reported in row-major order.
Constraints
grid.length = 2.grid[0].length = grid[1].length = 2.-10^9 <= grid[row][column] <= 10^9.
More Roblox Online Assessment questions
- Centered Block Placement QueriesOA · Seen Oct 2026
- Robot Navigation Around LasersOA · Seen Oct 2026
- Factory Batch Profit (Game Adaptation)OA · Seen Sep 2026
- Nested Recipe Blocks (Game Adaptation)OA · Seen Sep 2026
- Vehicle Builds for Required Terrain (Game Adaptation)OA · Seen Sep 2026
- Track Received Byte RangesOA · Seen Sep 2026
- Inventory Discount TrackerOA · Seen Sep 2026
- Break a PalindromeOA · Seen Jun 2026
- Count Pairs Differing in One DigitOA · Seen Oct 2025
- Cat Route Budget Planning (Game Adaptation)OA · Seen Aug 2025
Similar questions at other companies
- Survey Table: Group Given an AnswerSusquehanna International Group (SIG) · OASusquehanna International Group (SIG) interview questions
- Wind-Blown Leaves Remaining in a GridAbridge · OAAbridge interview questions
- Query a Header-Encoded MatrixNVIDIA · OANVIDIA interview questions
- Count Pieces After Othello MovesHudson River Trading · OAHudson River Trading interview questions
- Trapped Characters in a GridAdobe · OAAdobe interview questions
- Center Crop a Grayscale ImageLuma AI · OALuma AI interview questions
- Make Pixel Columns Strictly IncreasingMicrosoft · OAMicrosoft interview questions
- Check Matrix Reflection SymmetryIntuit · OAIntuit interview questions
- Tic-Tac-Toe Board StatusPinecone · OA
- Cherry PickupInfosys · OAInfosys interview questions