2181. Merge Nodes in Between Zeros | Linked List | How to Write Linked List Code

  Рет қаралды 1,452

Aryan Mittal

Aryan Mittal

Күн бұрын

In this video, I'll talk about how to solve Leetcode 2181. Merge Nodes in Between Zeros | Linked List | How to Write Linked List Code
Let's Connect:
📱Discord (Join Community) : / discord
📝Linkedin: / aryan-mittal-0077
📸 Instagram: / codewitharyanbhai
💻 Twitter - / aryan_mittal007
🤖 Github: github.com/ary...
About Me:
I am Aryan Mittal - A Software Engineer in Goldman Sachs, Speaker, Creator & Educator. During my free time, I create programming education content on this channel & also how to use that to grow :)
✨ Hashtags ✨
#programming #Interviews #leetcode #faang #maang #datastructures #algorithms

Пікірлер: 24
@Yashcolab
@Yashcolab 2 ай бұрын
0:40 i was not prepared for that
@ARYANMITTAL
@ARYANMITTAL 2 ай бұрын
Facts bro facts🌚🥲
@coderunner743
@coderunner743 2 ай бұрын
thanks, bro because of you I got placed in Zoho.
@ARYANMITTAL
@ARYANMITTAL 2 ай бұрын
Congratulations man ❤️🫡, big big Congratulations 🥳🔥
@coderunner743
@coderunner743 2 ай бұрын
@@ARYANMITTAL thanks bro
@naamnhibataunga5897
@naamnhibataunga5897 2 ай бұрын
this is my code: i think it is better because i didn't have to think of any edge cases. class Solution { public: ListNode* mergeNodes(ListNode* head) { ListNode *dummy=head; ListNode *curr=dummy; int sum=0; ListNode *temp=head; temp=temp->next; while(temp){ if(temp->val!=0){ sum+=temp->val; temp=temp->next; }else{ if(sum!=0){ curr->next=new ListNode(sum); curr=curr->next; } sum=0; temp=temp->next; } } ListNode *ans=dummy->next; delete dummy; return ans; } };
@sanebrain3083
@sanebrain3083 2 ай бұрын
i want to practice this list type of questions more like where i get to practice while complicated writing of code is there what to do can you give list of such question
@ARYANMITTAL
@ARYANMITTAL 2 ай бұрын
This will help, it has 20 very nice problems - kzbin.info/aero/PLEL7R4Pm6EmABenswDvaCGhiLNlExFKM8
@bhamidipatisatwik1165
@bhamidipatisatwik1165 2 ай бұрын
what about the case where there are two consecutive 0 nodes? is this case being handeled as there shouldn't be 0s in the resulatant list.
@NoName-hd7ok
@NoName-hd7ok 2 ай бұрын
Bro maine cf pe just expert touch kiya , dev me mern kiya h bs tutorial dekh kar , project bhi yt se chhapkar blog app bnaya h , intern ke liye next 1 month me kya krna chahiye , if from an avg NIT?
@arnavkaul7827
@arnavkaul7827 2 ай бұрын
make a project now but on your own think like a dev -read docs(verry underrated tip imo), utilise resources like stack overflow etc implement if it doesnt work repeat the process.. And bhai expert pahuchne pe kitna time laga and usme mujhe thode tips dede
@NoName-hd7ok
@NoName-hd7ok 2 ай бұрын
@@arnavkaul7827 ok bhai , nov se seriously kr rha tha cp
@worldofgaming748
@worldofgaming748 2 ай бұрын
0:40 "Bro is getting personal day by day"
@KarthikMadan-x5c
@KarthikMadan-x5c 2 ай бұрын
@karthikmadanaryan bhai goldman me apply krna rehgya please kuch help kr skte ho?
@karthikmadan
@karthikmadan 2 ай бұрын
aryan bhai goldman me apply krna rehgya please kuch help kr skte ho????
@dayashankarlakhotia4943
@dayashankarlakhotia4943 2 ай бұрын
ListNode mergeNodes (ListNode head){ ListNode p1=head.next,p2=p1; while(p2!=null){ int sum=0; while(p2!=null&&p2.val!=0){ sum+=p2.val; p2=p2.next; } p1.val=sum; p2=p2.next; p1.next=p2; p1=p1.next; } return head.next; } 🎉❤
@ARYANMITTAL
@ARYANMITTAL 2 ай бұрын
Awesome Daya Shankar 🫡❤️
@user-zz9pr5mu8o
@user-zz9pr5mu8o 2 ай бұрын
whose company ask these question
@sagaragrawal6315
@sagaragrawal6315 2 ай бұрын
class Solution { public: ListNode* mergeNodes(ListNode* head) { ListNode* dummy=new ListNode(); ListNode* temp=dummy; while(head->next!=nullptr){ dummy->next=head; head=head->next; dummy=dummy->next; while(head!=nullptr&&head->val!=0){ dummy->val+=head->val; head=head->next; } } dummy->next=nullptr; return temp->next; } }; this is also o(1) space na
@karthikmadan
@karthikmadan 2 ай бұрын
aryan bhai kuch help krdo Goldman ki date nikl gyi pls bhai
@ARYANMITTAL
@ARYANMITTAL 2 ай бұрын
Link bhejo bro job opening ka linkedin pr, recruiter ka email bhejte hai, its a long story why I would be recommending to apply via cold email to recruiter !!
@karthikmadan
@karthikmadan 2 ай бұрын
aryan bhai goldman me apply krna rehgya please kuch help kr skte ho?
@karthikmadan
@karthikmadan 2 ай бұрын
aryan bhai goldman me apply krna rehgya please kuch help kr skte ho?
АЗАРТНИК 4 |СЕЗОН 1 Серия
40:47
Inter Production
Рет қаралды 1,2 МЛН
Whoa
01:00
Justin Flom
Рет қаралды 54 МЛН
When you discover a family secret
00:59
im_siowei
Рет қаралды 32 МЛН
Real Or Cake For $10,000
00:37
MrBeast
Рет қаралды 58 МЛН
Coding Was HARD Until I Learned These 5 Things...
8:34
Elsa Scola
Рет қаралды 347 М.
Merge Nodes in Between Zeros - Leetcode 2181 - Python
11:24
NeetCodeIO
Рет қаралды 7 М.
3075. Maximize Happiness of Selected Children | Greedy | Amazon
6:33
Merge Nodes in Between Zeros | LeetCode 2181 | Coders Camp
11:33
Coders Camp
Рет қаралды 1,2 М.
I Parsed 1 Billion Rows Of Text (It Sucked)
39:23
Theo - t3․gg
Рет қаралды 133 М.
The Biggest Issues I've Faced Web Scraping (and how to fix them)
15:03
АЗАРТНИК 4 |СЕЗОН 1 Серия
40:47
Inter Production
Рет қаралды 1,2 МЛН