Skip to content

Commit 1720d53

Browse files
committed
Added comments
1 parent d577418 commit 1720d53

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Medium/minimum-passes-of-matrix.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ def convertNegatives(matrix):
1616
nextPassQueue = []
1717

1818
while len(currentPassQueue) > 0:
19+
# pop(0) is not a linear method. To make it linear we can treat the queue as a stack and just use pop(). However, if we use the second approach to solve this (as mentioned in AlgoExpert), we need to use a deque object to make it linear. We can however safely assume this is a linear time operation.
1920
row, column = currentPassQueue.pop(0)
2021
adjacentPositions = getAdjacentPositions(row, column, matrix)
2122
for position in adjacentPositions:

0 commit comments

Comments
 (0)