Indeed | Karat | Word Search, Sudoku
Anonymous User
2994

Phone karat interview

OOD questions

Composition vs Inheritance, Dependency injection.

Testing related questions

Unit tests, mocks, regression

Indeed (Karat) | Phone Interview | Word Search - LeetCode Discuss

Word Search - LeetCode

Word Search II - LeetCode

Phone karat interview redo

Web/API questions (Cookies, HTTP status)

Algorithms/Data structures questions theory

Valid Sudoku - LeetCode

Validate 2d grid with sequences

0 0 1 1 0 1 -> [2, 1]

0 1 1 0 0 1 → [2, 1]

0 0 0 0 0 0 → [0]

0 1 0 1 0 1 → [1,1,1]

rows: [2,1], [2,1], [0], [1,1,1]
columns : [0], [1,1], [2], [1,1],[0],[2,1]

Explaination :
A group means sequence of consecutive 1s in either row or column

First row has 2 groups of size 2, 1
Second row has 2 groups of size 2, 1
Third row has 0 groups
Fourth row has 3 groups of size 1

Similary first column has 0 groups
Second column has 2 groups of size 1, 1
Third column has 1 group of size 2 and so on..

So this test case should return true.

Test case 2 :
0, 0 -> [1]
1, 0 -> [0]

rows -> [1], [0]
Columns -> [1], [0]
This test case should return false.

Comments (4)