Google Interview Question for Software Engineers
- 2of 2 votes
[Google On-site 2018 Winter]- aonecoding4 November 28, 2018 in United States
Set Matrix Zeroes II
There are orbs on an NxM board ('O' denotes orb. 'X' denotes empty slot).
Whenever two orbs are in the same column or the same row, you get to erase one of them.
Try to erase as many orbs as possible.
Find the minimum number of orbs remained on board eventually.
erase (0,0) and get
erase (2,0) and get
erase (5,0) and get
no more moves available. Return 2 e.g.
erase(4,2), (2,2), (0,0), (2,0), (5,0)
erase(0,0), (1,1), (3,2)
Follow-up Build a solver for this board game that erases the as many orbs as possible.
| Report Duplicate | Flag | PURGE
Google Software Engineer
Interview Type: In-Person
Open Chat in New Window