Minimize the Heights | Love Babbar DSA Sheet Q9 | Arrays
Vložit
- čas přidán 11. 09. 2024
- ✅ Useful Links
𝐈𝐧𝐬𝐭𝐚𝐠𝐫𝐚𝐦 - / codingwithprakash
𝐖𝐡𝐚𝐭𝐬𝐀𝐩𝐩𝐂𝐡𝐚𝐧𝐧𝐞𝐥 - whatsapp.com/c...
𝐋𝐢𝐧𝐤𝐞𝐝𝐢𝐧 - / prakash-shukla
SUBSCRIBE AND HIT BELL ICON TO CHECK MORE OF MY CONTENT
czcams.com/users/Pra...
Minimize the Heights | Love Babbar DSA Sheet Q9 | Arrays
𝐌𝐔𝐒𝐈𝐂 𝐂𝐑𝐄𝐃𝐈𝐓
Track: Julius Dreisig & Zeus X Crona - Invisible [NCS Release]
Music provided by NoCopyrightSounds.
Watch: • Julius Dreisig & Zeus ...
Free Download / Stream: ncs.io/Invisibl... Complete Crash Course at prakashshukla.com
Track: Axollo - Silence (ft. Josh Bogert) [NCS Release]
Music provided by NoCopyrightSounds.
Watch: • Axollo - Silence (ft. ...
Free Download / Stream: ncs.io/ASilence
Thanks sir.....I am struggling with the question from two days but After Watching your video....this Question is looking so easy.
❤️❤️ keep going bhai this was confusing pblm for me
Thank you Sir, it helped me a lot!! after referring multiple explanations for this question, finally i came to this video and now its clear to me
Great Explanation Sir, After watching a lot of videos now I get the exact intuition from your's
Thank you so much 🙏🙏
+1
i saw all the u tube videos for this question solution at last i found urs ....really very good explanation🤩
Thanks a lot sir... I didn't understand this question clearly even after watching tech skeleton video but i did after watching yours... Great explanation ❣
Bahut jayada hi clear.
Very well done.
you deserve more subscribers, excellent explanation.
Easiest solution explanation i have watched so far. You deserve more subscribers
Thanks for this video sir. Very well explained.
Sir you made this question too easy very well explained👍👍✌
lovely explanation by you sir thanks alot
Thank You Sir for this awesome and genuine content.
This q looked difficult to me before but now its a piece of cake for me.
All thanks to you Sir, May GBU with lots of love long life success happiness and enjoyment
Thanks a lot again
Thanks bhai,aapki video dekh kar hi mujhe clear hua. Make more videos-- your new subscriber
Thanks rishabh
Thanks a lot bro after wasting my lots of time on other videos finally got this question understood well by you ! 😁😁
@@aadarshkeerti000 try krte rho mainly dry run karo jada...
Thank you so much Bhai, this was the best solution for this question. Keep making such videos. You have earned my subscription
best explanation of this question on youtbe
thanks bro for precise and simple solution
best explanation than other viedeos
Only video that helps, tysm
great explanation thanks a lot
Great Explanation....
wow simplest explanation ever
Perfectly explained
💯
Nice explanation brother.
Very well explained...
I am glad I found this one at last, no one else explained this well
A simple and great explanation👌
best solution ever
superb explanation
Absolutely amazing explaination sir!!!!!
thankyou so much sir
Most welcome!
thank you prakash bhai
Int diff = arr[n-1] - arr[0]
Yeh isliye kiya to handle a edge case of (arr[n-1] + k ) - (arr[0] + k )
Yeh bhi ek minimum difference ka candidate hai
nice bhai, Thank you
Nice explanation 🔥
best explanation guruji
Bhai bohot sahi explain kiya hai
well explained
in question they mentioned we have to perform k operation in each element,
so why u don't perform k operation in your first diff operation
Thank you sir
great work..
Keep going ❤❤
clean and clear
nice explanation
super bhaiya keep going
❤
Best explanation
can anyone explain the line no 52 ????
keep going bhaiya
C language code and code breakdown will help better understand.
#include
#include
// Qsort Time Complexity is O(nlogn) where n is no of elements in an array and Loop Interates is O(n)
// Space complexity is O(logn) due to recursive call of sorting alogithm
// Helper function to swap two integers
void swap (int* a, int* b)
{
int temp = *a;
*a = *b;
*b = temp;
}
// Helper Function to compare two integers for Qsort
int compare (const void *a, const void *b)
{
return (*(int *)a - *(int *)b);
}
// Function to minimize the max difference between heights
int minimizeMaxDiff(int arr[], int n, int k)
{
if (n big)
swap(&small,&big);
// Traverse middle Elements
for (int i; i=small || add
thanks ur r good
U too
sir please upload some videos on time complexity. I am very confused.
Krta hu try
thek hai
sir ye kuch alag level ka question tha...toh inka logic find krne mein toh dhoti khul jaaegi
max - min -2k ni kar skte kya
bro concept samaj nhi aaya kya karru
???
is this question available on leetcode , if yes provide no.
Not all test cases are getting cleared - using C++
What is wrong in my code? Can someone help?
class Solution {
public:
int getMinDiff(int arr[], int n, int k) {
int mini = INT_MAX;
int maxi = INT_MIN;
for (int i = 0; i < n; i++){
if(arr[i]
use long long instead of int
🙏
not running for test casses
1 5 8 10
if k=2
Acthually
Not helpful could not get the concept
✅ Useful Links
𝐈𝐧𝐬𝐭𝐚𝐠𝐫𝐚𝐦 - instagram.com/codingwithprakash/
𝐖𝐡𝐚𝐭𝐬𝐀𝐩𝐩𝐂𝐡𝐚𝐧𝐧𝐞𝐥 - whatsapp.com/channel/0029VaACtTa4tRrpDCQc5f44
𝐋𝐢𝐧𝐤𝐞𝐝𝐢𝐧 - www.linkedin.com/in/prakash-shukla/
Thank you sir, for great Explaination🙏😇
great explanation 🤩
Great explanation