Daily Leetcode Challenge | NOV 22 | HINDI | Flip Columns For Maximum Number of Equal Rows

  Рет қаралды 55

Let us code

Let us code

Күн бұрын

Пікірлер: 3
@darshankumar5546
@darshankumar5546 2 күн бұрын
Proud to say, my solution is better than, leetcode's official solution😇
@darshankumar5546
@darshankumar5546 2 күн бұрын
English Explanation: kzbin.info/www/bejne/gZvJlnZuopmrb7c
@darshankumar5546
@darshankumar5546 2 күн бұрын
# SOLUTION better than leetcode's official solution: class Solution: def maxEqualRowsAfterFlips(self, matrix: List[List[int]]) -> int: m=len(matrix) n=len(matrix[0]) nums=[] for num in matrix: l=len(num) val=0 for i in range(l): val+=(num[i])*(2**(l-i-1)) nums.append(val) print(nums) visited=set() eligible=set([0,(2**(n))-1]) MaxAns=0 for i in range(m): if(i in visited): continue ans=1 for j in range(i+1,m): if(j in visited): continue if((nums[i]^nums[j]) in eligible): ans+=1 visited.add(j) MaxAns=max(MaxAns,ans) visited.add(i) print(f"{ans} nos has same BITpattern as that of:{nums[i]}") return MaxAns # [ # [0,0,0], # [0,0,1], # [1,1,0] # ] # [0,0,1] # -->[0,0,1] # -->[1,1,0] # xor result shld be: # [0,0,0] or [1,1,1] # decimal: 0 or 7 (2**3 -1)
Daily Leetcode Challenge | NOV  23 | Rotating the Box
17:44
Let us code
Рет қаралды 19
Real Man relocate to Remote Controlled Car 👨🏻➡️🚙🕹️ #builderc
00:24
Hoodie gets wicked makeover! 😲
00:47
Justin Flom
Рет қаралды 134 МЛН
World’s strongest WOMAN vs regular GIRLS
00:56
A4
Рет қаралды 52 МЛН
📌 2Sum Problem in Java - 3 Effective Approaches Explained
32:54
How Senior Programmers ACTUALLY Write Code
13:37
Thriving Technologist
Рет қаралды 1,6 МЛН
I bet you can understand NgRx after watching this video
22:48
Joshua Morony
Рет қаралды 189 М.
A Very Nice Math Olympiad Problem | Can you solve for x? | Algebra Equation
13:14
62. .NET Framework vs .NET Core vs .NET vs .NET Standard vs C#
25:14
CSS Popover + Anchor Positioning is Magical
20:44
Kevin Powell
Рет қаралды 30 М.
Real Man relocate to Remote Controlled Car 👨🏻➡️🚙🕹️ #builderc
00:24