Completely Passable Grid Lines
Updated
Problem statement
You are given a non-empty rectangular grid of characters. A 0 is passable and a + is impassable.
Return a two-element list. Its first list contains, in increasing order, every zero-based row index whose cells are all passable. Its second list contains, in increasing order, every zero-based column index whose cells are all passable.
Function
passableLines(grid: String[]) → List<List<Integer>>Examples
Example 1
grid = ["000","0+0","000"]return = [[0,2],[0,2]]Rows 0 and 2 and columns 0 and 2 contain only passable cells.
Example 2
grid = ["++","++"]return = [[],[]]No row or column is completely passable.
Constraints
1 <= grid.length.1 <= grid[i].length.- Every row has the same length.
- The grid contains at most
4,096cells. - Every cell is
0or+.
More Splunk Phone Screen questions
Similar questions at other companies
- Validate a Chess Bishop, Rook, or Queen MoveGlean · PHONE SCREENGlean interview questions
- One-Nearest-Neighbor Classification with Manhattan DistanceOpenAI · PHONE SCREENOpenAI interview questions
- Unique Pairs in a 2D Matrix Summing to TargetAmazon · PHONE SCREEN
- Map Black Cells to Covering 2x2 BlocksSquare · PHONE SCREEN
- Trace an Eight-Direction Robot Until BlockedPinterest · PHONE SCREENPinterest interview questions
- Excel Training Data and Model Response AuditMicrosoft · PHONE SCREENMicrosoft interview questions
- Count Connect-Four Scoring LinesBloomberg LP · PHONE SCREENBloomberg LP interview questions
- Target Cells in One Block per Row and ColumnWhatNot · PHONE SCREENWhatNot interview questions
- Mark a Queen’s Attack BoardMotive · PHONE SCREENMotive interview questions
- Multiply Two MatricesAdobe · PHONE SCREENAdobe interview questions