L02:ARRAYS , Maximum Absolute Difference , Interview Bit

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

Aryan Mittal

Aryan Mittal

Күн бұрын

Пікірлер: 36
@ankitgoyal8556
@ankitgoyal8556 4 жыл бұрын
Go for it, it's crisp and short and easy to understand. Thank you
@drayc290
@drayc290 4 жыл бұрын
I have a crucial doubt. When we are simply subtracting max of one of these quantities from the min, how are we sure that the (i,j) pair that gives the max and the min respectively, satisfy the initial conditions of that case in the first place? Like let's say index i has max(x + a[x]) and index j has min(x + a[x]). When we subtract this quantities we are not making sure that i > j and a[i] > a[j]. So how are we still getting right answer?
@sanjeeeeev
@sanjeeeeev 3 жыл бұрын
there is no condition for i and j
@harshitavyas7497
@harshitavyas7497 2 жыл бұрын
I ALSO HAVE SAME DOUBT
@dakshsingh5891
@dakshsingh5891 Жыл бұрын
Value of i and j can be anything it doesn’t necessarily have to be i>j and similarly this is also possible a[i]
@RiyaSingh-mq1vb
@RiyaSingh-mq1vb 2 жыл бұрын
Great Explanation
@nayanbhuyan8156
@nayanbhuyan8156 3 жыл бұрын
If you want to solve standard problems for interviews, try making videos from the Love Babbar 450 questions of DSA
@kartiksaini135
@kartiksaini135 4 жыл бұрын
What Algorithmic tool does it use?? (Greedy or DP)
@gayathri-8-i6s
@gayathri-8-i6s 2 жыл бұрын
Why we avoided the negative part??
@anshumansingh510
@anshumansingh510 2 жыл бұрын
thought process deserves 5stars
@heyya7357
@heyya7357 3 жыл бұрын
Finally got the best solution of this problem
@gyr8567
@gyr8567 2 жыл бұрын
Your brute force approach was neat. I would also like to see the efficient approach
@rithikrk3695
@rithikrk3695 Жыл бұрын
thanks man
@RAHULKUMAR-xy4wz
@RAHULKUMAR-xy4wz 4 жыл бұрын
Nice explanation with the right approach.
@SuperPrksh
@SuperPrksh 4 жыл бұрын
Sir how to develop such kind of intuition to solve this kind of questions?
@ARYANMITTAL
@ARYANMITTAL 4 жыл бұрын
These are some standard problems , soon you will find that they occur many times so ultimately you will get used to this !!
@piyushkumarrajput2779
@piyushkumarrajput2779 4 жыл бұрын
​@@ARYANMITTALsir, can you please make a playlist of those problems. so that we can develop such intution. thank you in advance
@gayathri-8-i6s
@gayathri-8-i6s 2 жыл бұрын
@@piyushkumarrajput2779 yes . We will get benefitted if he do so
@amansingh.h716
@amansingh.h716 13 күн бұрын
its impossible till we see some kind of solutions ,thats why i hate DSA
@PaAGadirajuSanjayVarma
@PaAGadirajuSanjayVarma 4 жыл бұрын
ALso what about third and fourth case bro??
@parthsinghparihar1904
@parthsinghparihar1904 4 жыл бұрын
Can u make a video on "Partition"prblm of array section, interviewbit
@srikanthtekumudi3948
@srikanthtekumudi3948 3 жыл бұрын
very clear explanation...thank you....
@Learnwithpractice960
@Learnwithpractice960 4 жыл бұрын
thanks bro this video helped alot
@parthsinghparihar1904
@parthsinghparihar1904 4 жыл бұрын
Well explained!!
@dheerajchaudhary645
@dheerajchaudhary645 4 жыл бұрын
Why can't we directly use this-> abs(max(arr) - min(arr)) + abs(index(max(arr)) - index(min(arr)))
@nirajgusain1452
@nirajgusain1452 3 жыл бұрын
because it will give you wrong ans, try to dry run on your own, with some negative values.
@faizankhan5877
@faizankhan5877 4 жыл бұрын
Great
@atulvidyarthi133
@atulvidyarthi133 4 жыл бұрын
great explaination
@hiteshusingh8571
@hiteshusingh8571 4 жыл бұрын
great explanation
@PaAGadirajuSanjayVarma
@PaAGadirajuSanjayVarma 4 жыл бұрын
bro but last example in interview bit says as follows: f(2, 3) = f(3, 2) = |3 - (-1)| + |2 - 3| = 5 Here |2-3| should be -1 as per your formula (of Modulus) but in order to get result of 5 it should be 1.So plz tell me bro??
@sita476
@sita476 4 жыл бұрын
its better to take example while explain
@saurav4180
@saurav4180 4 жыл бұрын
Advertisements every minute making it worse.
@devendersinghrathore8837
@devendersinghrathore8837 3 жыл бұрын
geeksforgeeks pe solution dekhke to koi bhi smjha sakta hai//
@harshitavyas7497
@harshitavyas7497 2 жыл бұрын
I have a crucial doubt. When we are simply subtracting max of one of these quantities from the min, how are we sure that the (i,j) pair that gives the max and the min respectively, satisfy the initial conditions of that case in the first place? Like let's say index i has max(x + a[x]) and index j has min(x + a[x]). When we subtract this quantities we are not making sure that i > j and a[i] > a[j]. So how are we still getting right answer?
@harshitavyas7497
@harshitavyas7497 Жыл бұрын
@alfred whatever i did, how it is bothering you?
@harshitavyas7497
@harshitavyas7497 Жыл бұрын
@alfred Sometimes a problem raised by someone is not resolved timely and when others also face the same problem they also raise the issue so that it becomes visible and solved. Hope you understand.
L01 : ARRAYS , Max Sum Contiguous Subarray , Interview Bit
12:27
Aryan Mittal
Рет қаралды 1,8 М.
Counter-Strike 2 - Новый кс. Cтарый я
13:10
Marmok
Рет қаралды 2,8 МЛН
Jaidarman TOP / Жоғары лига-2023 / Жекпе-жек 1-ТУР / 1-топ
1:30:54
OCCUPIED #shortssprintbrasil
0:37
Natan por Aí
Рет қаралды 131 МЛН
Median of two Sorted Arrays of Different Sizes | Binary Search
31:54
take U forward
Рет қаралды 240 М.
The Dome Paradox: A Loophole in Newton's Laws
22:59
Up and Atom
Рет қаралды 1,1 МЛН
Is an Indian MBA Worth It? | Reality Check | Warikoo Career Hindi
17:51
494. Target Sum | Memoization | Bottom Up Optimized | DP
23:10
Aryan Mittal
Рет қаралды 1,4 М.
Longest Consecutive Sequence | Leetcode(Hard) | GooGLe
13:47
take U forward
Рет қаралды 145 М.
Moore voting algorithm
7:46
Techdose
Рет қаралды 108 М.
Counter-Strike 2 - Новый кс. Cтарый я
13:10
Marmok
Рет қаралды 2,8 МЛН