Skip to content

Latest commit

 

History

History
27 lines (21 loc) · 907 Bytes

File metadata and controls

27 lines (21 loc) · 907 Bytes

Google Interview Quesion

made-with-python

Convert non-adjacent ones to zero and return this array. If a number not found on the outside line is not connected with other ones on the outside line, it is converted to zero.

Algorithm


Class name: Corner Methods:

  • findCorner(): Detect corners
  • findNeighbor(): Detect all neighbor (With Recursion)
  • checkUp(): Check upper neighbor
  • checkLeft(): Check left neighbor
  • checkRight(): Check right neighbor
  • checkDown(): Check down neighbor
  • processArray(): Convert 1 to 0

Input


input

Output


out