PRODUCT OF TWO RUN-LENGTH ENCODED ARRAYS | PYTHON | LEETCODE # 1868

  Рет қаралды 2,853

Cracking FAANG

Cracking FAANG

Күн бұрын

In this video we are solving a popular Facebook and Twitter interview question: Product of Two Run-Length Encoded Arrays (Leetcode # 1868).
This is a pretty straightforward two pointer based solution though it may take seeing the solution once to be able to wrap your head around why it works and how this is truly the most optimal way to solve the question.

Пікірлер: 10
@bhushankhope8949
@bhushankhope8949 7 ай бұрын
Nice explanation.
@SriHarshaBolisetti
@SriHarshaBolisetti 2 жыл бұрын
Perfect explanation :)
@92AkshaySharma
@92AkshaySharma 8 ай бұрын
man good job explaining this one.
@mohammadkareem1187
@mohammadkareem1187 2 жыл бұрын
Thanks for the clear explanation and great video. My only comment is to use a pen rather than a mouse when you write. Good luck
@crackfaang
@crackfaang 2 жыл бұрын
Totally agree with you but the channel is still too small to warrant buying an iPad + magic pencil just to write a little bit cleaner. I see the video analytics and most people just jump to the code anyway so the cost/benefit of investing in that right now is not skewed in the right direction. I probably will eventually because using a mouse sucks 😂
@mohammadkareem1187
@mohammadkareem1187 2 жыл бұрын
@@crackfaang if I pass my upcoming interview, I will buy you an iPad + magic pencil ;)
@lcgrind
@lcgrind 5 ай бұрын
Ty! I had the same intuition in terms of optimizating the solution, but couldn't translate it into code. How would you update your solution if modifying the input is not allowed?
@lcgrind
@lcgrind 5 ай бұрын
Answering my own Q if anyone else wonders; we can create two additional variables to keep track of the frequencies; init these to the frequency for the first val/freq element of the encoded array (repsectveily); in each iteration, get the min frequency and substract these from the two variables. If their value is 0, advance their respective pointer, and retrieve the frequency only if their pointer is less than their respective encoded size. I hope this helps others! and GL with your prep!
@abhi23pawar
@abhi23pawar 5 ай бұрын
What about carry? say 9x9 = 81
NUMBER OF GOOD LEAF NODE PAIRS | PYTHON | LEETCODE # 1530
17:13
Cracking FAANG
Рет қаралды 2,2 М.
EXCLUSIVE TIME OF FUNCTIONS | LEETCODE 636 | PYTHON SOLUTION
15:42
Cracking FAANG
Рет қаралды 4 М.
Amazing weight loss transformation !! 😱😱
00:24
Tibo InShape
Рет қаралды 67 МЛН
Gym belt !! 😂😂  @kauermotta
00:10
Tibo InShape
Рет қаралды 18 МЛН
НРАВИТСЯ ЭТОТ ФОРМАТ??
00:37
МЯТНАЯ ФАНТА
Рет қаралды 8 МЛН
DOT PRODUCT OF TWO SPARSE VECTORS - 3 SOLUTIONS EXPLAINED [PYTHON]
31:06
ROBOT ROOM CLEANER | LEETCODE # 489 | PYTHON BACKTRACK SOLUTION
19:44
Just In Time (JIT) Compilers - Computerphile
10:41
Computerphile
Рет қаралды 267 М.
but what is 'a lifetime?
12:20
leddoo
Рет қаралды 65 М.
NEXT PERMUTATION | LEETCODE # 31 | PYTHON OPTIMAL SOLUTION
18:50
Cracking FAANG
Рет қаралды 8 М.
LOWEST COMMON ANCESTOR OF A BINARY TREE II | PYTHON | LEETCODE 1644
20:46
RANDOM PICK INDEX | LEETCODE # 398 | PYTHON RESERVOIR SAMPLING
14:56
BEST MEETING POINT | LEETCODE 296 | PYTHON OPTIMAL SOLUTION
18:06
Cracking FAANG
Рет қаралды 1,7 М.
LOWEST COMMON ANCESTOR OF A BINARY TREE III [PYTHON]
16:38
Cracking FAANG
Рет қаралды 9 М.
VALID PALINDROME III | LEETCODE 1216 | PYTHON MEMOIZED DFS SOLUTION
16:01
Rate This Smartphone Cooler Set-up ⭐
0:10
Shakeuptech
Рет қаралды 7 МЛН
Tag him😳💕 #miniphone #iphone #samsung #smartphone #fy
0:11
Pockify™
Рет қаралды 4,7 МЛН
Vision Pro наконец-то доработали! Но не Apple!
0:40
ÉЖИ АКСЁНОВ
Рет қаралды 525 М.
Xiaomi SU-7 Max 2024 - Самый быстрый мобильник
32:11
Клубный сервис
Рет қаралды 553 М.
Проверил, как вам?
0:58
Коннор
Рет қаралды 390 М.