MAXIMUM SPLIT OF POSITIVE EVEN INTEGERS | LEETCODE # 2178 | PYTHON SOLUTION

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

Cracking FAANG

Cracking FAANG

2 жыл бұрын

In this video we are solving a cool Google interview question: Maximum Split of Positive Even Integers (Leetcode # 2178).
On the surface this seems like quite the tricky question but once you see the solution it's very simple and intuitive as to how you are supposed to solve it.

Пікірлер: 8
@tianmingguo8271
@tianmingguo8271 Жыл бұрын
Hi Cracking FAANG. Thank you for the explanation. For finding the index, you could use index=(cur_sum-finalSum)//2-1 to find index fast since your res list is ordered even numbers.
@TheQuancy
@TheQuancy 2 жыл бұрын
Explanations are some of the best ive seen. It's up there with Neetcode. Thank you
@crackfaang
@crackfaang 2 жыл бұрын
Thanks! I'd say better than Neetcode but maybe I'm biased 😂
@AnandKumar-kz3ls
@AnandKumar-kz3ls Жыл бұрын
great explanation as always one thing to add here time complexity would be sqrt(finalSum) lets say 2 + 4 + ... + 2*N = finalSum we need to find the value of N 2*(1 + 2 + .... N) = finalSum (N*(N+1)) = finalSum finalSum approx equal to N = sqrt(finalSum) approx
@subee128
@subee128 6 ай бұрын
Thank you very much
@harjeetkajal
@harjeetkajal 2 жыл бұрын
What is N in the time complexity?
@gstar10811
@gstar10811 2 жыл бұрын
The code is nice and simple, but how can we prove it?
@crackfaang
@crackfaang 2 жыл бұрын
No clue. We aren’t here to prove the solution works. As long as you can write the code and understand the solution well enough to explain it clearly and concisely, that’s all that matters. The interviewers have no clue about the proof, let alone candidates under pressure 😂
MAXIMUM FREQUENCY STACK | LEETCODE # 895 | PYTHON OPTIMAL SOLUTION
12:48
Задержи дыхание дольше всех!
00:42
Аришнев
Рет қаралды 3,8 МЛН
Doing This Instead Of Studying.. 😳
00:12
Jojo Sim
Рет қаралды 23 МЛН
Получилось у Миланы?😂
00:13
ХАБИБ
Рет қаралды 6 МЛН
Это реально работает?!
00:33
БРУНО
Рет қаралды 3,3 МЛН
2178 And All That Part 1
29:59
Experimental mathematics
Рет қаралды 3,6 М.
LeetCode 1610. Maximum Number of Visible Points
15:59
Happy Coding
Рет қаралды 4,6 М.
K-TH MISSING POSITIVE NUMBER | LEETCODE 1539 | PYTHON SOLUTION
11:00
Cracking FAANG
Рет қаралды 2,5 М.
BEST MEETING POINT | LEETCODE 296 | PYTHON OPTIMAL SOLUTION
18:06
Cracking FAANG
Рет қаралды 1,7 М.
The Traveling Salesman Problem: When Good Enough Beats Perfect
30:27
Single-Threaded CPU - Priority Queue - Leetcode 1834 - Python
17:20
Compiled Python is FAST
12:57
Doug Mercer
Рет қаралды 105 М.
LARGEST PALINDROMIC NUMBER | LEETCODE 2384 | PYTHON SOLUTION
14:56
Cracking FAANG
Рет қаралды 1,6 М.
📱магазин техники в 2014 vs 2024
0:41
djetics
Рет қаралды 694 М.
Look, this is the 97th generation of the phone?
0:13
Edcers
Рет қаралды 8 МЛН