Go for it, it's crisp and short and easy to understand. Thank you
@drayc2904 жыл бұрын
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?
@sanjeeeeev3 жыл бұрын
there is no condition for i and j
@harshitavyas74972 жыл бұрын
I ALSO HAVE SAME DOUBT
@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-mq1vb2 жыл бұрын
Great Explanation
@nayanbhuyan81563 жыл бұрын
If you want to solve standard problems for interviews, try making videos from the Love Babbar 450 questions of DSA
@kartiksaini1354 жыл бұрын
What Algorithmic tool does it use?? (Greedy or DP)
@gayathri-8-i6s2 жыл бұрын
Why we avoided the negative part??
@anshumansingh5102 жыл бұрын
thought process deserves 5stars
@heyya73573 жыл бұрын
Finally got the best solution of this problem
@gyr85672 жыл бұрын
Your brute force approach was neat. I would also like to see the efficient approach
@rithikrk3695 Жыл бұрын
thanks man
@RAHULKUMAR-xy4wz4 жыл бұрын
Nice explanation with the right approach.
@SuperPrksh4 жыл бұрын
Sir how to develop such kind of intuition to solve this kind of questions?
@ARYANMITTAL4 жыл бұрын
These are some standard problems , soon you will find that they occur many times so ultimately you will get used to this !!
@piyushkumarrajput27794 жыл бұрын
@@ARYANMITTALsir, can you please make a playlist of those problems. so that we can develop such intution. thank you in advance
@gayathri-8-i6s2 жыл бұрын
@@piyushkumarrajput2779 yes . We will get benefitted if he do so
@amansingh.h71613 күн бұрын
its impossible till we see some kind of solutions ,thats why i hate DSA
@PaAGadirajuSanjayVarma4 жыл бұрын
ALso what about third and fourth case bro??
@parthsinghparihar19044 жыл бұрын
Can u make a video on "Partition"prblm of array section, interviewbit
@srikanthtekumudi39483 жыл бұрын
very clear explanation...thank you....
@Learnwithpractice9604 жыл бұрын
thanks bro this video helped alot
@parthsinghparihar19044 жыл бұрын
Well explained!!
@dheerajchaudhary6454 жыл бұрын
Why can't we directly use this-> abs(max(arr) - min(arr)) + abs(index(max(arr)) - index(min(arr)))
@nirajgusain14523 жыл бұрын
because it will give you wrong ans, try to dry run on your own, with some negative values.
@faizankhan58774 жыл бұрын
Great
@atulvidyarthi1334 жыл бұрын
great explaination
@hiteshusingh85714 жыл бұрын
great explanation
@PaAGadirajuSanjayVarma4 жыл бұрын
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??
@sita4764 жыл бұрын
its better to take example while explain
@saurav41804 жыл бұрын
Advertisements every minute making it worse.
@devendersinghrathore88373 жыл бұрын
geeksforgeeks pe solution dekhke to koi bhi smjha sakta hai//
@harshitavyas74972 жыл бұрын
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 Жыл бұрын
@alfred whatever i did, how it is bothering you?
@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.