Complete the code to initialize the starting row index for spiral traversal.
top := [1]The top row index starts at 0 because matrix indexing begins at 0.
Complete the code to update the left column index after traversing the top row.
left [1]= 1
After traversing the top row, we move the left boundary right by increasing it by 1.
Fix the error in the loop condition to continue spiral traversal while boundaries are valid.
for top [1] bottom && left [2] right {
The loop continues while top is less than or equal to bottom and left is less than or equal to right.
Fill both blanks to correctly traverse the right column from top to bottom.
for i := [1]; i [2]= bottom; i++ { result = append(result, matrix[i][right]) }
The loop starts at top and continues while i is less than or equal to bottom to traverse down the right column.
Fill all three blanks to traverse the bottom row from right to left correctly.
for i := [1]; i [2] [3]; i-- { result = append(result, matrix[bottom][i]) }
The loop starts at right, continues while i is greater than or equal to left, and decrements i to move leftwards.
