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

Method left

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

Source from the content-addressed store, hash-verified

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):
92 return result
93 while 1:
94 try:
95 # matrix
96 if matrix[y][x] == 'x' or x < 0:
97 raise IndexError
98 result.append(matrix[y][x])
99 matrix[y][x] = 'x'
100 x -= 1
101 except IndexError:
102 x += 1
103 return self.up(matrix, x, y-1, result, stop)
104
105 def up(self, matrix, x, y, result, stop):
106 if checkStop(matrix, x, y):

Callers 1

downMethod · 0.95

Calls 2

upMethod · 0.95
checkStopFunction · 0.85

Tested by

no test coverage detected