Hey bro, I hope you had an incredible trip! I just want to take a moment to thank you for everything you're doing. I currently work at TCS with a very low package, but your support has really motivated and inspired me. I'm feeling super pumped, and I hope to transition to a better company soon. Thanks again for everything, Mik. I truly pray that all your dreams come true.
@gui-codes19 күн бұрын
You got this bro. I am also in a similar path and got a job in a service based company and now preparing for product based company. Let's do this.
@gamerboy18819 күн бұрын
@@gui-codes we got this bro , let's gooooo
@arnabsarkar524519 күн бұрын
All the best buddy.
@aws_handles19 күн бұрын
Let’s do this 🔥🔥🔥
@dibbodas411619 күн бұрын
finally after few days mik sir is back✅✅
@gui-codes19 күн бұрын
The LEGEND is back 🔥 Waited eagerly to see your videos.
@amanpaliwalvlogs686018 күн бұрын
Radhe Radhe ❤❤
@ansh655219 күн бұрын
Finally MIK sir is back ❤️ Sir ho sake to kal wala potd karado copy paste kiya tha kal wala 😅
@ravirathore671719 күн бұрын
I solved it today on my own, thanks for boosting my confidence.
@parulawasthi735318 күн бұрын
Bhaiya i have been following you for last two months and i could see growth in my problem solving ability. Thankyou so much for providing us with the intuitiveness to solve the questions. If possible then please cover the leetcode and codechef contests as well.
@Believe_yourself-eo1ho19 күн бұрын
I am done BRUTE FORCE BFS + Selection Sort Thank you you are back ❤❤❤❤ Please continue DP CONCEPT WALA PLAYLIST 🙏🙏🙏
@arohi327714 күн бұрын
can you give me solution pls
@Believe_yourself-eo1ho14 күн бұрын
@arohi3277 int SelectionSort(vector&temp){ int idx = 0; int n = temp.size(); int No_of_Operation = 0; for(int i=0;ileft); if(front->right) q.push(front->right); } operation += SelectionSort(temp); } return operation; }
@Believe_yourself-eo1ho14 күн бұрын
@@arohi3277 int SelectionSort(vector&temp){ int idx = 0; int n = temp.size(); int No_of_Operation = 0; for(int i=0;ileft); if(front->right) q.push(front->right); } operation += SelectionSort(temp); } return operation; }
@shraban850819 күн бұрын
Finally you are back sir!! Please cover leetcode contests problems!!
@VK_BRANDING19 күн бұрын
return of the king
@Coder_Buzz0719 күн бұрын
Mik bhaiya is back finally ❤❤
@dhirajkumawat10819 күн бұрын
Wait a lot for your Video ❤❤
@gui-codes19 күн бұрын
same
@jeehub04119 күн бұрын
Bhaiya is back ❤❤
@sandeepvishwakarma894919 күн бұрын
we need yesterday 's solution by you only ❤❤
@codestorywithMIK19 күн бұрын
Yes coming tomorrow for full details and many things to learn ❤️🙏
@codestorywithMIK19 күн бұрын
Yes coming tomorrow with full details and extra things to learn ❤️🙏
@akashcodeeerrrr19 күн бұрын
GOAT 🐐 Is back ❤
@aws_handles19 күн бұрын
MIK is back 😍 Thanks for the clear explanation
@dynamicvk230818 күн бұрын
Sir, your code of minimum_no_of_swaps function used in this code fails for one testcase in gfg problem: minimum no. of swaps to sort an array at last 1111th test case, could you please tell why it happen because it works correctly for leetcode, It would be very helpful sir
@robot3.07719 күн бұрын
Sir kal ke potd ki ek video solution bana dena. wo infosys ke interview me poochaa gaya tha
@iamnoob75935 күн бұрын
what infosys is asking leetcode medium questions??
@robot3.0774 күн бұрын
@@iamnoob7593 bro for specialist programmer role 9.5 lpa
@iamnoob75935 күн бұрын
Amazing explanation , Is it modified selection sort , If array had duplicates , we may have to go with another approach for finding min swaps.
@shrutigrover509219 күн бұрын
Great Video
@anonymoushackerar750719 күн бұрын
I used BFS + Cyclic Sort to solve this
@anonymoushackerar750719 күн бұрын
Here's my Solution: class Solution { public: int minSwapsToSort(vector& arr) { int n = arr.size(); vector arrWithIndex(n); // Pair array elements with their indices for (int i = 0; i < n; i++) { arrWithIndex[i] = {arr[i], i}; } // Sort the array by element values sort(arrWithIndex.begin(), arrWithIndex.end()); vector visited(n, false); // To keep track of visited elements int swaps = 0; for (int i = 0; i < n; i++) { // If already visited or in the correct position, skip if (visited[i] || arrWithIndex[i].second == i) { continue; } // Count the size of the cycle int cycleSize = 0; int current = i; while (!visited[current]) { visited[current] = true; current = arrWithIndex[current] .second; // Move to the next index in the cycle cycleSize++; } // If there is a cycle of size > 1, it contributes (size - 1) swaps if (cycleSize > 1) { swaps += (cycleSize - 1); } } return swaps; } int minimumOperations(TreeNode* root) { // At Same Level, so we'll go with BFS queue q; q.push(root); int ans = 0; while (!q.empty()) { int size = q.size(); vector treeNodeVals; for (int i = 0; i < size; i++) { TreeNode* temp = q.front(); q.pop(); if (temp->left != NULL) { treeNodeVals.push_back(temp->left->val); q.push(temp->left); } if (temp->right != NULL) { treeNodeVals.push_back(temp->right->val); q.push(temp->right); } } ans += minSwapsToSort(treeNodeVals); } return ans; } };
@amanpatel857518 күн бұрын
@@anonymoushackerar7507 This actually works for GFG Problem: Minimum Swaps to Sort Array.
@rajashreeparhi154919 күн бұрын
I am solving questions, working hard..still I am only facing rejections..either my code doesn't run or ques becomes too tricky.... my luck doesn't play well...I am very demotivated.
@vaibhav45419 күн бұрын
Saal m kitne din ghumte ho mik bhai
@princesahu535618 күн бұрын
bhaiya no of swap dekhne ke liye kyu na ham given array ko sorted array se compare kr le like jis index pe number different honge us samay count++ kar denge and at last count/2 kar denge kyuki jis number se swap hua usme bhi to count++ hoga so is type se number of swap nikal jyega !!
@devlpr-nitish19 күн бұрын
We missed you
@tanmaychanda39818 күн бұрын
how is storing in map and comparing with the sorted vector is making sure that the swaps are minimum??
@abhinay.k18 күн бұрын
thanks
@VarunSahu-tv5rj19 күн бұрын
Bhiya codeforces contest ka solution discuss Kiya kro please aap chijo ko acha explain krte hai 🙏
@vallendsouza19 күн бұрын
Sir, joh 2 din ka upload karna hai voh wale videos kab tak aayenge?
@KeshavKumar-jh2en19 күн бұрын
if time please leetcode contest.... dp on last sunday problem
@abhaymaurya917 күн бұрын
ham 2nd type wala bfs kb lagate hai ? koi video hai aapki jismai specifically apne ye bataya ho? when we use first one and when we use 2nd one BFS aur agar ham hamesha size wala BFS use kre to galti hogi kya?
@anonymoushackerar750719 күн бұрын
MIK Bhaiya, last 2 Days ki POTD ki video kab ayegi? 🥺🥺
@AbcDef-e1m1f19 күн бұрын
Bhaii please kl wala problem ka solution bna do Apna aadat lga diye ho bhaiii or kl solution nhi aaya 😢
@annagarg256719 күн бұрын
sahi bola😂, ab kisi aur se smjhn ka man nhi krta
@ManojKrVerma-vw4dx11 күн бұрын
Hi MIK, I am not sure ki ye swap count min hi kyun hai ? How is it ensuring ki issie kam swaps mei ye achieve nahi ho sakta. Please help reply.
@331sachinkiragi818 күн бұрын
Bro weekly contests ka atleast 3rd question ek kara do plz for every week
@KishanSingh-vc3re18 күн бұрын
bhaiya ye sb to bn jata h, please thoda contests k b questions dekheye na, audience for that will be large too ! and we need it. please. the question MAXIMIZE AMOUNT AFTER TWO DAYS OF CONVERSION had me long to think and likewise.
@ShivamSharma-vf4uf18 күн бұрын
SIR PLEASE SOLVE 21 DEC AND 22 DEC Problem of the day as you skipped these problems on that day @codestorywithMIK
@Ununtag18 күн бұрын
Hi MIK, the function of "Minimum Swaps to sort" doesn't work and gives wrong answer on GFG site on the last test case. could you please let me know why?
@NitishRaj-q3s18 күн бұрын
yes, i also facing the same problem.
@meetdobariya877719 күн бұрын
Last two days ke hard questions banao plz
@AyushGupta2916419 күн бұрын
Bhaia maine abhi dsa seekhna start hi kara hain. please aap muje bata do ki main apke channel ka use kaise karun effeciently. main pahle ek topic ka theory dekh lu fir usi topic ki jo playlist apne banyi hain usme se questions karuun. Please thoda detail main samja do maine apka chaneel 1 week pahle hi discover kara hain itni saari vedios hain har playlist main mujhe dekh kar samaj nahi aa raha haiin kaise padhu unse
@codestorywithMIK19 күн бұрын
First see this. It will help you get started - kzbin.info/www/bejne/aHvWmZmlnJZ4isksi=VWnPD-3-tjfcttT1
@vishwashsoni61019 күн бұрын
sir this is how i solved this question ... /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), left(nullptr), right(nullptr) {} * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {} * TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), left(left), right(right) {} * }; */ class Solution { public: int minSwaps(vector& arr){ int n = arr.size(); vectornums; for(int i=0;ileft){ pq.push(temp->left); } if(temp->right){ pq.push(temp->right); } } result += minSwaps(arr); } return result; } };
@codestorywithMIK19 күн бұрын
Well done. Clean code 👍🏻
@Your_Sandy0719 күн бұрын
Ish BFS ka concept konsa video mein hain????
@gui-codes19 күн бұрын
aise to kai videos me bataya hai sir ne is BFS waali cheez ko but latest ek video aai thi sir ki "Reverse Odd Levels of Binary Tree" - Leetcode-2415 usme bataya tha fir se .
@Your_Sandy0719 күн бұрын
@gui-codes thanks for ur information bro but BFS ka koi playlist hain kya???
@Tejas-Coder18 күн бұрын
@@Your_Sandy07 Graph playlist me hain
@DevanshGupta-io7rl19 күн бұрын
int solve(vector &v){ int swaps=0,n=v.size(); vectortemp=v; sort(begin(temp),end(temp)); unordered_mapmp; for(int i=0;ileft); if(it->right) q.push(it->right); } ans+=solve(v); } return ans; } my solution. important cheez thi min swaps to get array sorted jo wo decode kr liya smjho question ho gya.. or yahi maine codeforces pe solve kri thi..
@jayanaaryan349818 күн бұрын
bhaiya kal aur purso ka potd upload kar samjh me nhi aaya
@codestorywithMIK18 күн бұрын
Coming tomorrow with details ❤️
@vibhanshusharma914319 күн бұрын
But but but what if àrray contain duplicate value 😅. If It has better time complexity than n*n . Plz tell me😊
@itsharshita2219 күн бұрын
Bhaiya mene ye code khud se likha h or jab dry run kia tha to ye code 3ino test cases k liye pass ho rha tha pr jab editor pr run kia to ye ek b test cases pass ni kr pa rha . Kya ap bta sakte h is question ko ese kyu ni kr sakte Code --> int minimumOperations(TreeNode* root) { int count = 0; queue que; que.push(root); while (!que.empty()) { int n = que.size(); vector vec; while (n--) { auto curr = que.front(); que.pop(); vec.push_back(curr); if (curr->left != NULL) { que.push(curr->left); } if (curr->right != NULL) { que.push(curr->right); } } int l = 0; int r = vec.size() - 1; while (l < r) { if (vec[l]->val > vec[r]->val) { auto temp = vec[l]->val; vec[l]->val = vec[r]->val; vec[r]->val = temp; l++; count++; } else { r--; } } } return count; }
@gui-codes19 күн бұрын
can you share which test case is failing ?
@learn_in_shorts19 күн бұрын
Hello bhaiya kaise ho aap, Bhaiya mujhse ek help chahiye thi aapse plz 🙏 meyne bahut try Kiya but kahi nhi hua, bhaiya final year ke liye project banana hai to uske liye pahle guide registration karna hai and mujhse koi nahi mil rha hai, requirement for guide is ( btech + 5 year experience in job / teaching). Bhaiya aap kisi ko bologe ya phir aapke contact mey koi hoto plz contact kardo, college mey jab tak guide registration nahi karunga tab tak aage proceed nhi kar sakta, bas formality karna hai bhaiya only guide ka details submit karna hai bas itna plz bhaiya help me 🙏🙏🙏🙏