DEV Community

Discussion on: A Google Interview Question

Collapse
 
dbenchi profile image
David BENCHI

I have a question: why this ["01111", "01101", "00011", "11110"] should return 3?
"01111"
"01101"
"00011"
"11110"
I can only see 2 contiguous lines of zeros: I will represent them as dots of (row, column)

  • (1,1)(2,1)(3,1)
  • (3,1)(3,2)(3,3)

Where is the third one?

Collapse
 
cindyytong profile image
Cindy Tong

@dbenchi Thanks for catching that. Typo on my end. It should be 2, I also added a 3rd scenario

  • For strArr = ["110", "000", "111"], return 1.
Collapse
 
dbenchi profile image
David BENCHI • Edited

Thanks for the fix. However in the new example, this should return 2 not 1. Am I right?

Thread Thread
 
cindyytong profile image
Cindy Tong

Yes! LOL not my day today, appreciate you keeping me in check :) @dbenchi