MCPcopy Create free account
hub / github.com/HuberTRoy/leetCode / down

Method down

Array/SpiralMatrix.py:75–88  ·  view source on GitHub ↗
(self, matrix, x ,y, result, stop)

Source from the content-addressed store, hash-verified

73 return self.down(matrix, x, y+1, result, stop)
74
75 def down(self, matrix, x ,y, result, stop):
76 if checkStop(matrix, x, y):
77 return result
78 while 1:
79 try:
80 # matrix
81 if matrix[y][x] == 'x':
82 raise IndexError
83 result.append(matrix[y][x])
84 matrix[y][x] = 'x'
85 y += 1
86 except IndexError:
87 y -= 1
88 return self.left(matrix, x-1, y, result, stop)
89
90 def left(self, matrix, x, y, result, stop):
91 if checkStop(matrix, x, y):

Callers 1

rightMethod · 0.95

Calls 2

leftMethod · 0.95
checkStopFunction · 0.85

Tested by

no test coverage detected