Тёмный

2181. Merge Nodes in Between Zeros || LeetCode POTD || Explained in HINDI 

ReelCoding
Подписаться 581
Просмотров 63
50% 1

Instagram link:- / reelcoding
/ @reelcoding
Approach:-
Initialization:
A dummy node is created to help build the new linked list.
cur pointer is used to traverse the original linked list, and newCur pointer is used to build the new linked list.
Traverse and Sum:
We traverse the list and calculate the sum of values between zeros.
When a zero is encountered, a new node with the sum is added to the new linked list.
End of List:
The process continues until the end of the linked list is reached.
The dummy node's next pointer points to the head of the new linked list containing the merged nodes.
Time and Space Complexity:
Time Complexity:
Traversing the linked list: O(n) where n is the number of nodes in the linked list.
Overall time complexity: O(n).
Space Complexity:
Space for the new linked list: O(n) since we are creating a new linked list of nodes.
Overall space complexity: O(n).
Background Music for Videos: www.bluetreeau...
Whether you're new to problem-solving or seeking insights into Java programming techniques, this video offers valuable insights into tackling similar challenges effectively.
Do join with me guys for daily problem solving on LeetCode.
Please like and subscribe this channel and share among your friends, it helps me to motivate and bring more videos for you guys. ❤️❤️
Soon, DSA batch (Hinglish) is going to launch on this channel. So, do subscribe so that you will get the notification for all new videos.👍👍🔔🔔.
Do comment if any doubts left. Thank you 😊
#leetcode #computerscience #leetcodesolutions #leetcodequestionandanswers #code #learning #dsalgo #dsa
#CodingExplanation #AlgorithmTutorial #JavaProgramming #DataStructures #DynamicProgramming #CodeExplanation #ProgrammingTutorial #AlgorithmExplanation #TechTutorial #LearnToCode #ProblemSolving #ProgrammingConcepts #SoftwareDevelopment #TechEducation #CodingCommunity #CodeBreakdown #ComputerScience
#JavaTutorial #AlgorithmAnalysis #EducationalContent
2181. Merge Nodes in Between Zeros
Leetcode 2181
Merge Nodes in Between Zeros
Leetcode daily challenge
Leetcode potd
2181 Merge Nodes in Between Zeros
leetcode potd today solution
leetcode potd today
leetcode grind
leetcode questions for interview
leetcode series
leetcode hindi

Опубликовано:

 

16 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 1   
@reelcoding
@reelcoding 3 месяца назад
Code link:- leetcode.com/problems/merge-nodes-in-between-zeros/solutions/5413907/java-solution-explained-in-hindi/
Далее
🤔ЗАЧЕМ ОНИ ЭТО ДЕЛАЮТ?🤦‍♂️
00:49
РЫБКА С ПИВОМ
00:39
Просмотров 1,5 млн
HackSussex Coders' Cup 2024
2:37:14
Просмотров 854 тыс.
10 Common Coding Interview Problems - Solved!
2:10:50
Просмотров 584 тыс.