Watching #MikSir while travelling #WellExplained 🔥 🔥
@codestorywithMIK Жыл бұрын
Means a lot 😍. Btw, hats off to your dedication ❤
@thekindspill Жыл бұрын
woooahh 🔥
@EB-ot8uu7 ай бұрын
itni dedication mujhe bhi chaie bhai
@chaitanya812 Жыл бұрын
watching even after solving .. all thanks to you
@codestorywithMIK Жыл бұрын
Means a lot. Thank you 🙏😇❤️
@abhishekverma7604 Жыл бұрын
now my brain crafts story for every problem,now i look up any problem from different perspective.. this channel will hit mark what no DSA channel has ever done before...
@codestorywithMIK Жыл бұрын
It means a lot to me. Thank you so much for your kind words ❤️😇🙏
@dhairyachauhan6622 Жыл бұрын
Thank you bhaiya till now no one had taught recursion so well, making recursion trees like you do. Now i am so good with it i solved todays question on my own, maybe not in the most efficient way but i did it in o(n) time and space using resursion. Only problem is code is not clean 😅😅 class Solution { public: int findLen(ListNode*head){ int len = 0; while(head!= NULL){ head = head->next; len++; } return len; } vector ans; void solve(ListNode*head,int k,int divisions,int extra){ if(k == 0){ coutnext; } if(curr){ curr->next = NULL; } ans.push_back(head); solve(nextHead,k-1,divisions,extra); } vector splitListToParts(ListNode* head, int k) { // step 1 find the length of linked list if(head == NULL){ while(k>0){ ans.push_back(NULL); k--; } return ans; } int len = findLen(head); int divisions = 1; int extra = 0; if(k
@sachinmohanty4577 Жыл бұрын
bhai thoda thought process share karoge recursion kaise aaya dimag mei starting se? i am asking because LL ke sawal mei itertaive way hi dimag mei aata hei mostly mujhe. waiting for you response! thank you!!
@wearevacationuncoverers Жыл бұрын
wow bro
@gui-codes2 ай бұрын
one of the best explanations man. You easily beat other youtubers in explanation skills.
@shauryan23 Жыл бұрын
Recently Discovered your channel brother. And loved your content. Keep posting 🔥🔥🔥
@codestorywithMIK Жыл бұрын
Welcome to my small channel. Thank you so much for watching and your kind words ❤️❤️🙏🙏😇😇
@thegreekgoat982 ай бұрын
Kya aadmi hai yaar.. kya samjhata h...
@codestorywithMIK2 ай бұрын
Hope my video helps ❤️🙏
@thekindspill Жыл бұрын
I never thought I would be able understand DSA with so much clarity. It's because of you #MIK Thanks a lot
@mohithadiyal6083 Жыл бұрын
Simply superrrr 😊
@rounaq_khandelwal Жыл бұрын
ye remainder nodes wla concept i do remember, u taught in past in some other video, due to which I could solve this qn, I was so happy to see ki whi concept apply ho rha!! #mikBhaiRocks
@codestorywithMIK Жыл бұрын
So glad to know 😇🙏❤️
@AdarshTiwari-r5f8 ай бұрын
great storytelling sir hats off to you sir
@EB-ot8uu7 ай бұрын
Insane level of teaching
@aizad786iqbal2 ай бұрын
amazing, just watching your story helps me write the code, I always get confused and think of while loops only when it comes to trees linked list etc... which makes the code logic complex class Solution { public ListNode[] splitListToParts(ListNode head, int k) { int n = 0; ListNode temp = head; while(temp != null){ n++; temp=temp.next; } int rem = n%k; int parts = n/k; ListNode[] result = new ListNode[k]; ListNode curr = head; ListNode prev = null; if(head == null){ return result; } for(int i=0; i
@himanshuyadav06002 ай бұрын
Already solved but still watching sir ..🔥🔥🔥. Sir please try to upload weekly contest solutions also. Atleast last 2 questions of contest . It would be great. Thank you #MikSir
@codestorywithMIK2 ай бұрын
Maximum Number of Moves to Kill All Pawns | Step By Step Detailed | Leetcode 3283 | codestorywithMIK kzbin.info/www/bejne/pqvCpJ-Cir5qsJI
@AlishaKhan-ww3io Жыл бұрын
thank you for making every problem look easy 😃
@ugcwithaddi Жыл бұрын
Masterpiece explanation. I was able to code it in between from your story. Thanks a lot ❤
@utkarshjain6755 Жыл бұрын
God level explaination sir ♥
@abhaykumar4680 Жыл бұрын
Happy Teacher's day sir
@codestorywithMIK Жыл бұрын
Thank you ♥️😊 Happy Teachers’ Day to you too
@pintushkumar7542 Жыл бұрын
Nice Explanation sir Sir gfg ka POTD ka bhi video banaye Aise me sir daily ka do problem solve hoga
@JoyAcharyatvl Жыл бұрын
Awesome bhai. Thanks.
@MohammedHasmi5772 ай бұрын
Sir cant describe in worrs u r just amazing teacher 🔥🔥🔥
@codestorywithMIK2 ай бұрын
Means a lot ❤️🙏😇
@anuppatankar4294 Жыл бұрын
GREAT VIDEO 🔥
@vedantdhole34226 ай бұрын
best explanation
@GAURAVKUMAR-dr4mq Жыл бұрын
Your explanation is quite good. Can you teach on live session on KZbin or somewhere else.
@AkOp-bf9vm2 ай бұрын
MY CODE class Solution { public: int findLen(ListNode*head){ int cnt=0; while(head){ head=head->next; ++cnt; } return cnt; } ListNode* divide(int each,ListNode*&temp){ if(each==0 || temp==NULL) return NULL; ListNode* head = temp; for (int i = 0; i < each - 1; ++i) { temp = temp->next; } if (temp) { ListNode* nxtNode = temp->next; temp->next = nullptr; temp = nxtNode; } return head; } vector splitListToParts(ListNode* head, int k) { vector result; ListNode*temp=head; int len=findLen(head); int each=len/k; int extra=len%k; ListNode*guest=NULL; for(int i=0;i
@Tejaswi-xd4re Жыл бұрын
Sir when will leetcode question video come for beginners
@UtkarshPatel-v9o Жыл бұрын
nice explanation bhaiya
@codestorywithMIK Жыл бұрын
Thank you 😇🙏
@mileshsoni5016 Жыл бұрын
bhai please 1 video leetcode 1007 pe bana do bht confusion h ki kyu wo dp se solve ni hoga, Great explanation BTW abhi tw bht aage jana h :)
@amanverma5278 Жыл бұрын
Good explantion...
@codestorywithMIK Жыл бұрын
Glad you liked it 😊♥️
@TheBusaSinger Жыл бұрын
Helpful topic! Thanks!
@dayashankarlakhotia4943 Жыл бұрын
class solution { public List Node []split List To Part(List Node head,int k){ List Node cur =head; List Node []ans=new List Node [k]; int len=0,ptr=0; while (cur!=null){ len++; cur =cur. next; } int remian =len %k, int part len =len/k; cur =head; while (cur!=null){ ans[ptr++]= cur; int current len =part len-1+((remian-->0)?1:0); for(int i=0;i
@AnandKumar-kz3ls Жыл бұрын
great explanation here is my code class Solution { public: vector splitListToParts(ListNode* head, int k) { int n=0; ListNode* t=head; while(t){ t=t->next; n++; } vector result(k,nullptr); ListNode* next_node; int i=0; int rem=(n%k); int size=0; while(head){ size = n/k; if(rem) size++; ListNode* start = head; while(--size > 0 && head->next){ head=head->next; } result[i]=start; next_node=head->next; head->next=nullptr; head=next_node; if(rem>0) rem--; i++; } return result; } };
@rajkrishanmahajan2373 Жыл бұрын
my solution class Solution { public: vector splitListToParts(ListNode* head, int k) { ListNode* curr = head; int n = 0; while (curr) { n++; curr = curr->next; } int part_size = n / k; int remaining = n % k; curr = head; vector ans; for (int i = 0; i < k; i++) { ans.push_back(curr); int current_part_size = part_size + (i < remaining ? 1 : 0); for (int j = 0; j < current_part_size - 1; j++) { curr = curr->next; } if (curr) { ListNode* temp = curr->next; curr->next = nullptr; curr = temp; } } return ans; } };
@codestorywithMIK Жыл бұрын
Awesome ❤️
@tutuimam3381 Жыл бұрын
❤❤❤
@floatingpoint7629 Жыл бұрын
remainder nodes will never exceed then k thats the reason or this logic works
@yashhhh740 Жыл бұрын
hello bhaiya, conceptual clarity ke liye kha se video dekhu? aapke toh video question solution vale hainn naa
@k.vabhavmishra Жыл бұрын
bhai Questions ke through bhi seekh sakta h
@aman3210 Жыл бұрын
thankyou bhaiya ++;
@taneyasoni Жыл бұрын
6/100
@Letskrakcode3 ай бұрын
sir approach ajati hai but code karte waqt promblem hota hai or error bhi ata hai please help and guide
@lotusjoshi9 ай бұрын
** * Definition for singly-linked list. * struct ListNode { * int val; * struct ListNode *next; * }; */ /** * Note: The returned array must be malloced, assume caller calls free(). */ struct ListNode** splitListToParts(struct ListNode* head, int k, int* returnSize) { struct ListNode *current=head; int l=0; while(current!=NULL) { l++; current=current->next; } current=head; struct ListNode* prev=NULL; struct ListNode** result=(struct ListNode**)malloc(k * sizeof(struct ListNode*)); int geteachelement=l/k; int reminderelement=l%k; for(int i=0;inext!=NULL;count++) { prev=current; current=current->next; } if(prev!=NULL) { prev->next=NULL; } prev=NULL; } *returnSize=k; return result; } Getting error in leetcode
@NiveditaKar-xj6ew Жыл бұрын
JAVA SOLUTION : class Solution { public ListNode[] splitListToParts(ListNode head, int k) { ListNode temp=head; ListNode ans[]=new ListNode[k]; int l=0; while(temp!=null) { l++; temp=temp.next; } ListNode curr=head; ListNode prev=null; int part=l/k,rem=l%k; for(int i=0;i0?1:0; for(int j=0;j
@codestorywithMIK Жыл бұрын
Thank you for sharing Java 😇🙏
@harshit68712 ай бұрын
aj k contest 414 leetcode ki video daal do bhaiya ji🙏
@codestorywithMIK2 ай бұрын
Maximum Number of Moves to Kill All Pawns | Step By Step Detailed | Leetcode 3283 | codestorywithMIK kzbin.info/www/bejne/pqvCpJ-Cir5qsJI
@srashtigupta23893 ай бұрын
leetcode pe nhi chlrha ye code please modify krke do
@prudhvirajmacherla9854 Жыл бұрын
I didn't understand the last if condition if(prev! =null) prev. Next=null
@prudhvirajmacherla9854 Жыл бұрын
Can u explain plz
@lotusjoshi9 ай бұрын
Can someone can provide the code in c😢😢
@hi-tk4hu Жыл бұрын
I wrote this. please check it to see if you find it easier to understand and im little confused about time complexity its O(N) ig class Solution { private: int getLen(ListNode* head) { int l = 0; ListNode* ptr = head; while(ptr) { l++; ptr = ptr->next; } return l; } public: vector splitListToParts(ListNode* head, int k) { vector res; int l = getLen(head); int rem = 0, size = 1, cnt = 0; ListNode* prev = NULL; ListNode* ptr = head; ListNode* start = head; cout
@NITianMonika Жыл бұрын
I'm getting error Line 36: Char 19: runtime error: member access within null pointer of type 'ListNode' (solution.cpp) SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior prog_joined.cpp:45:19