Amazon & Apple Interview Problem

  Рет қаралды 37,633

Sahil & Sarra

Sahil & Sarra

26 күн бұрын

Пікірлер: 34
@gamesx8528
@gamesx8528 15 күн бұрын
Bro this is giving me anxiety
@lOmaine777
@lOmaine777 24 күн бұрын
Is this the one they call Kadane's algorithm or something
@messiisthebest
@messiisthebest 24 күн бұрын
Yes
@soumyadeepdas770
@soumyadeepdas770 24 күн бұрын
This video has subtitles available.
@jeromelawrence9819
@jeromelawrence9819 23 күн бұрын
Using sliding windows algorithm is much easier
@TF2Shows
@TF2Shows 20 күн бұрын
it wont work with negative numbers
@waidenf
@waidenf 14 күн бұрын
thats for fixed lengths genius.
@ahmadramadhan9043
@ahmadramadhan9043 23 күн бұрын
u can using prefix sum and make variable to save the minimum prefix sum and then every index you check if the current prefix minus minimum prefix before
@prabhatjha653
@prabhatjha653 24 күн бұрын
Nice, thought of the same solution, but didn’t know this is the famous Kadane’s algorithm, I always hear this name but didn’t knew. Thanks
@rohitgarg3942
@rohitgarg3942 4 күн бұрын
Two pointers/sliding window
@jackybanh8105
@jackybanh8105 24 күн бұрын
the issue with your solution, you memorised a specific algorithm to solve the question optimally. this is not the point of the coding interview, its literally a proxy on how you approach the answer not memorising a technique
@user-qs1lh1qv1d
@user-qs1lh1qv1d 20 күн бұрын
what colour is your lamborgini?
@sathwikreddy175
@sathwikreddy175 24 күн бұрын
By currentmax will point at arr[0] and add arr[1] and check cuurentmax is less than or greater than arr[i] and update it to max sofar the highest values ant iterate
@Manoharofficial180
@Manoharofficial180 21 күн бұрын
Why your solving the question in python
@boomer698
@boomer698 24 күн бұрын
is he speaking english cuz i dont understand a word😢
@jonathanjohnson2785
@jonathanjohnson2785 22 күн бұрын
He has an accent but I understand him perfectly. Very helpful Sahil❤
@ahmadabid7845
@ahmadabid7845 23 күн бұрын
What if we devise the array into two other arrays negative and positive and we just add up the positive array but this doesn't match the example ig is that ok?
@LikemyCommentt
@LikemyCommentt 13 күн бұрын
It should be continuous
@Vivek-ru9vd
@Vivek-ru9vd 17 күн бұрын
we can do it by brute force
@ForgottenKnight1
@ForgottenKnight1 23 күн бұрын
It's funny how the first example is wrong - the largest subarray would be [1,4,2,1,4] - why ? because nowhere in that requirement is there any specifications about not dismissing duplicates. Also, why would you choose e negative number that will decrease your sum? That's just dumb, imho. Even [4,2,1] would have been a better option. Who makes these problems ? :)))
@sahilandsarra
@sahilandsarra 23 күн бұрын
If only you could do one Google search
@shantanushekharsjunerft9783
@shantanushekharsjunerft9783 24 күн бұрын
Isn’t 1,4,2,1,4 the subarray with largest sum?
@Shhhh-ni5jw
@Shhhh-ni5jw 24 күн бұрын
That’s a subsequence
@gunabaki7755
@gunabaki7755 23 күн бұрын
A subarray should contain only contiguous elements, not just random nums from array
@entertainercartoons
@entertainercartoons 23 күн бұрын
​@@Shhhh-ni5jw can you explain that
@ForgottenKnight1
@ForgottenKnight1 23 күн бұрын
@@Shhhh-ni5jw An array is a collection, and can contain one or more elements, or none, in any order, with duplication or without. What are you talking about?
@SOSSVT
@SOSSVT 24 күн бұрын
Do they impose a language or you could solve the problem with any coding language?
@snehalpatil7528
@snehalpatil7528 24 күн бұрын
Any language is fine
@user-fc6wv1wy7e
@user-fc6wv1wy7e 24 күн бұрын
@@snehalpatil7528 wait so like they would give you this problem and you would try and solve it on any programming language or you have to use your brain to solve it
@rohhanbhardwaj
@rohhanbhardwaj 18 күн бұрын
​​​@@user-fc6wv1wy7ebro any language works
@aquibchishti8503
@aquibchishti8503 24 күн бұрын
this is brain f 😮🎉😢
@lisiasty688
@lisiasty688 19 күн бұрын
Can't we just try add number and if number lowers sum then revert this? For every number in array And then not reverted numbers will be just numbers than are not in subarray I think it would be O(n)
@hapfsunion017
@hapfsunion017 24 күн бұрын
1st comment 😂
If Programming Was An Anime
3:26
Joma Tech
Рет қаралды 10 МЛН
Top 10 System Design problems you must know
8:09
Sahil & Sarra
Рет қаралды 11 М.
Super sport🤯
00:15
Lexa_Merin
Рет қаралды 19 МЛН
I PEELED OFF THE CARDBOARD WATERMELON!#asmr
00:56
HAYATAKU はやたく
Рет қаралды 38 МЛН
SHE WANTED CHIPS, BUT SHE GOT CARROTS 🤣🥕
00:19
OKUNJATA
Рет қаралды 14 МЛН
Fastest way to get $100,000 remote job: InstaJob.io
5:35
Sahil & Sarra
Рет қаралды 150 М.
Top 6 Coding Interview Concepts (Data Structures & Algorithms)
10:51
SOLID Principles with Easy Examples in 6 Minutes
6:33
ThutariVision
Рет қаралды 177
8 patterns to solve 80% Leetcode problems
7:30
Sahil & Sarra
Рет қаралды 112 М.
Why Signals Are Better Than React Hooks
16:30
Web Dev Simplified
Рет қаралды 448 М.
System Design: Design a URL Shortener like TinyURL
16:00
Code Tour
Рет қаралды 77 М.
🚀  TOP 5 programming language for beginners in 2024
4:37
Valentyna in Tech
Рет қаралды 2,5 М.
Fastest way to become a Software Engineer in 2024
9:10
Sahil & Sarra
Рет қаралды 236 М.
5 Books Every Beginner Programmer Should Read
3:49
codevev
Рет қаралды 4 М.
Apple, как вас уделал Тюменский бренд CaseGuru? Конец удивил #caseguru #кейсгуру #наушники
0:54
CaseGuru / Наушники / Пылесосы / Смарт-часы /
Рет қаралды 4,3 МЛН
IPad Pro fix screen
1:01
Tamar DB (mt)
Рет қаралды 8 МЛН
M4 iPad Pro Impressions: Well This is Awkward
12:51
Marques Brownlee
Рет қаралды 6 МЛН