INSERT/DELETE/GETRANDOM() O(1) | PYTHON | LEETCODE # 380

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

Cracking FAANG

Cracking FAANG

Күн бұрын

Пікірлер: 2
@popcornpaat
@popcornpaat Ай бұрын
For those who may have been confused from the swapping that was described in the explanation versus whats actually coded, the swapping from the element to remove and the last element in the list doesn't happen explicitly in the code. We simply overwrite the element that we want to remove with the last element. At this point, we didn't swap and there are two of the same elements in the list - one at the recently overwritten value and still the last element. We pop the list to remove this duplicate element at the end. I got hung up from the explanation mentioning this swapping and was confused when I was trying to search for it in the code.
@subee128
@subee128 10 ай бұрын
Thanks
EXPRESSION ADD OPERATORS | LEETCODE # 282 | PYTHON SOLUTION
24:05
Cracking FAANG
Рет қаралды 7 М.
МЕНЯ УКУСИЛ ПАУК #shorts
00:23
Паша Осадчий
Рет қаралды 5 МЛН
Real Man relocate to Remote Controlled Car 👨🏻➡️🚙🕹️ #builderc
00:24
How Senior Programmers ACTUALLY Write Code
13:37
Thriving Technologist
Рет қаралды 1,6 МЛН
Insert Delete GetRandom O(1) - Leetcode 380 - Python
13:27
NeetCode
Рет қаралды 51 М.
REMOVE DUPLICATE LETTERS | LEETCODE 316 | PYTHON STACK SOLUTION
18:15
Cracking FAANG
Рет қаралды 2,4 М.
Next Greater Element I - Leetcode 496 - Python
14:53
NeetCode
Рет қаралды 79 М.
This Algorithm is 1,606,240% FASTER
13:31
ThePrimeagen
Рет қаралды 852 М.
Why Didn't He Get the Job? Let's Find Out! // Code Review
27:25
The Cherno
Рет қаралды 148 М.
Dynamic Programming isn't too hard. You just don't know what it is.
22:31
DecodingIntuition
Рет қаралды 197 М.
INSERT INTO CIRCULAR LINKED LIST | LEETCODE # 708 | PYTHON SOLUTION
15:25
The Absolute Best Intro to Monads For Software Engineers
15:12
Studying With Alex
Рет қаралды 670 М.