Great intro explanation, (in first 2 minutes) it is all one needs to hear and implement solution. list comprehension seems to be the hardest part of algorithm to understand: column = tuple(grid[r][col] for r in range(n)) , where [col] stays the same for whole column, only [r] is changing. LC solution can also be made with Counter: from collections import Counter class Solution: def equalPairs(self, grid: List[List[int]]) -> int: # Use Counter to store the frequency of each row represented as a tuple row_count = Counter(tuple(row) for row in grid) n = len(grid) pairs = 0 # Check each column against the row frequencies for col in range(n): # Construct the column as a tuple column = tuple(grid[row][col] for row in range(n)) # Add the number of matching rows to the count of pairs pairs += row_count[column] return pairs
@bullymaguire23352 ай бұрын
thanks mom
@Shadowpuppet-u9oАй бұрын
Though you're doing fantastic, I have more thing to ask: please slow down. You're explaining things so quickly.
@debrajghosh35692 ай бұрын
keep going deepti your concepts is good and your explanetion is also ok but it is little bit fast 😊😊😊😊😊😊
@SonGoku-cq6bh2 ай бұрын
Hey deepti what’s your ethnicity? You pretty cute!