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 ❣
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
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
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]
Bahut jayada hi clear.
Very well done.
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
Thanks bhai,aapki video dekh kar hi mujhe clear hua. Make more videos-- your new subscriber
Thanks rishabh
Great Explanation Sir, After watching a lot of videos now I get the exact intuition from your's
Thank you so much 🙏🙏
+1
best explanation of this question on youtbe
i saw all the u tube videos for this question solution at last i found urs ....really very good explanation🤩
you deserve more subscribers, excellent explanation.
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
Sir you made this question too easy very well explained👍👍✌
Thanks for this video sir. Very well explained.
lovely explanation by you sir thanks alot
Absolutely amazing explaination sir!!!!!
thankyou so much sir
Most welcome!
Thank you so much Bhai, this was the best solution for this question. Keep making such videos. You have earned my subscription
best explanation than other viedeos
thanks bro for precise and simple solution
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 ❣
Nice explanation brother.
great explanation thanks a lot
best solution ever
Only video that helps, tysm
wow simplest explanation ever
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...
best explanation guruji
superb explanation
Bhai bohot sahi explain kiya hai
Great Explanation....
nice bhai, Thank you
thank you prakash bhai
Perfectly explained
💯
Very well explained...
great work..
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 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
Easiest solution explanation i have watched so far. You deserve more subscribers
A simple and great explanation👌
well explained
great explanation 🤩
Best explanation
Thank you sir
super bhaiya keep going
nice explanation
Keep going ❤❤
I am glad I found this one at last, no one else explained this well
clean and clear
can anyone explain the line no 52 ????
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
keep going bhaiya
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
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
thanks ur r good
U too
sir please upload some videos on time complexity. I am very confused.
Krta hu try
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
thek hai
not running for test casses
1 5 8 10
if k=2
Acthually
❤
🙏
✅ Useful Links
𝐈𝐧𝐬𝐭𝐚𝐠𝐫𝐚𝐦 - instagram.com/codingwithprakash/
𝐖𝐡𝐚𝐭𝐬𝐀𝐩𝐩𝐂𝐡𝐚𝐧𝐧𝐞𝐥 - whatsapp.com/channel/0029VaACtTa4tRrpDCQc5f44
𝐋𝐢𝐧𝐤𝐞𝐝𝐢𝐧 - www.linkedin.com/in/prakash-shukla/
Not helpful could not get the concept
Thank you sir, for great Explaination🙏😇
Nice explanation 🔥
Great explanation