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 М.
Smart Sigma Kid #funny #sigma #memes
00:26
CRAZY GREAPA
Рет қаралды 6 МЛН
Опасность фирменной зарядки Apple
00:57
SuperCrastan
Рет қаралды 12 МЛН
Secret Experiment Toothpaste Pt.4 😱 #shorts
00:35
Mr DegrEE
Рет қаралды 38 МЛН
DOT PRODUCT OF TWO SPARSE VECTORS - 3 SOLUTIONS EXPLAINED [PYTHON]
31:06
KOKO EATING BANANAS | PYTHON | LEETCODE # 875
22:46
Cracking FAANG
Рет қаралды 1,5 М.
JPEG is Dying - And that's a bad thing
8:09
2kliksphilip
Рет қаралды 69 М.
LOWEST COMMON ANCESTOR OF A BINARY TREE II | PYTHON | LEETCODE 1644
20:46
Just In Time (JIT) Compilers - Computerphile
10:41
Computerphile
Рет қаралды 267 М.
VALID NUMBER | LEETCODE #65 | PYTHON SOLUTION
18:18
Cracking FAANG
Рет қаралды 4,5 М.
MAKING A LARGE ISLAND | LEETCODE # 827 | PYTHON SOLUTION
22:09
Cracking FAANG
Рет қаралды 6 М.
ACCOUNTS MERGE | LEETCODE # 721 | PYTHON SOLUTION
23:04
Cracking FAANG
Рет қаралды 10 М.
Why Isn't Functional Programming the Norm? - Richard Feldman
46:09
Ускоряем ваш TV🚀
0:44
ARTEM_CHIBA
Рет қаралды 331 М.
Samsung laughing on iPhone #techbyakram
0:12
Tech by Akram
Рет қаралды 7 МЛН
Как удвоить напряжение? #электроника #умножитель
1:00
Hi Dev! – Электроника
Рет қаралды 1,1 МЛН
Look, this is the 97th generation of the phone?
0:13
Edcers
Рет қаралды 8 МЛН