Enable ruff RUF002 rule (#11377)

* Enable ruff RUF002 rule

* Fix

---------

Co-authored-by: Christian Clauss <cclauss@me.com>
This commit is contained in:
Maxim Smolskiy
2024-04-22 22:51:47 +03:00
committed by GitHub
parent 79dc7c97ac
commit 4700297b3e
69 changed files with 132 additions and 131 deletions

View File

@ -31,7 +31,7 @@ Explanation: There is no 1 in the matrix.
Approach:
We initialize another matrix (dp) with the same dimensions
as the original one initialized with all 0s.
as the original one initialized with all 0's.
dp_array(i,j) represents the side length of the maximum square whose
bottom right corner is the cell with index (i,j) in the original matrix.
@ -39,7 +39,7 @@ bottom right corner is the cell with index (i,j) in the original matrix.
Starting from index (0,0), for every 1 found in the original matrix,
we update the value of the current element as
dp_array(i,j)=dp_array(dp(i1,j),dp_array(i1,j1),dp_array(i,j1)) + 1.
dp_array(i,j)=dp_array(dp(i-1,j),dp_array(i-1,j-1),dp_array(i,j-1)) + 1.
"""

View File

@ -89,7 +89,7 @@ def spiral_traversal(matrix: list[list]) -> list[int]:
Algorithm:
Step 1. first pop the 0 index list. (which is [1,2,3,4] and concatenate the
output of [step 2])
Step 2. Now perform matrixs Transpose operation (Change rows to column
Step 2. Now perform matrix's Transpose operation (Change rows to column
and vice versa) and reverse the resultant matrix.
Step 3. Pass the output of [2nd step], to same recursive function till
base case hits.