GitHunt
FK

fkahraman/Google-Coding-Interview-Question

Contains an algorithm for a question asked in a Google coding interview.

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

Contributors

MIT License
Created November 24, 2021
Updated November 24, 2021
fkahraman/Google-Coding-Interview-Question | GitHunt