Equal Row and Column Pairs - LeetCode 2352 - Python

  Рет қаралды 1,529

DEEPTI TALESRA

DEEPTI TALESRA

Күн бұрын

Пікірлер
@akshyanshunayak1127
@akshyanshunayak1127 2 ай бұрын
I can't stop watching you 😂 btw nice explanation
@deepakjyoti8355
@deepakjyoti8355 2 ай бұрын
I always look forward to your great videos.
@jst8922
@jst8922 2 ай бұрын
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
@bullymaguire2335
@bullymaguire2335 2 ай бұрын
thanks mom
@Shadowpuppet-u9o
@Shadowpuppet-u9o Ай бұрын
Though you're doing fantastic, I have more thing to ask: please slow down. You're explaining things so quickly.
@debrajghosh3569
@debrajghosh3569 2 ай бұрын
keep going deepti your concepts is good and your explanetion is also ok but it is little bit fast 😊😊😊😊😊😊
@SonGoku-cq6bh
@SonGoku-cq6bh 2 ай бұрын
Hey deepti what’s your ethnicity? You pretty cute!
I Solved 100 LeetCode Problems
13:11
Green Code
Рет қаралды 289 М.
Каха и дочка
00:28
К-Media
Рет қаралды 3,4 МЛН
Coding Was HARD Until I Learned These 5 Things...
8:34
Elsa Scola
Рет қаралды 839 М.
73. Set Matrix Zeroes | SDE Sheet
14:34
Aindrela Saha
Рет қаралды 202
How to Solve ANY LeetCode Problem (Step-by-Step)
12:37
Codebagel
Рет қаралды 330 М.
My Brain after 569 Leetcode Problems
7:50
NeetCode
Рет қаралды 2,7 МЛН
Max Consecutive Ones III #leetcode #leetcode75
9:19
DEEPTI TALESRA
Рет қаралды 685
How I would learn Leetcode if I could start over
18:03
NeetCodeIO
Рет қаралды 746 М.
8 patterns to solve 80% Leetcode problems
7:30
Sahil & Sarra
Рет қаралды 473 М.
Web Developers Are Disconnected
21:36
ThePrimeTime
Рет қаралды 208 М.
Hardy's Integral
13:47
Michael Penn
Рет қаралды 14 М.