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

Method up

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

Source from the content-addressed store, hash-verified

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):
107 return result
108
109 while 1:
110 try:
111 # matrix
112 if matrix[y][x] == 'x' or y < 0:
113 raise IndexError
114 result.append(matrix[y][x])
115 matrix[y][x] = 'x'
116 y -= 1
117 except IndexError:
118 y += 1
119 return self.right(matrix, x+1, y, result, stop)
120
121 def spiralOrder(self, matrix):
122 """

Callers 1

leftMethod · 0.95

Calls 2

rightMethod · 0.95
checkStopFunction · 0.85

Tested by

no test coverage detected