Skip to content

Commit 18314b2

Browse files
committed
Merge branch 'main' of github.com:yashi-15/codeharborhub into scroll-animations
2 parents 2188a20 + 752e80e commit 18314b2

File tree

2 files changed

+387
-93
lines changed

2 files changed

+387
-93
lines changed

dsa-solutions/lc-solutions/0000-0099/0002-Add-Two-Numbers.md

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ tags:
66
- Linked List
77
- Math
88
- Recursion
9+
- Add Two Numbers
10+
- LeetCode
911
description: "This is a solution to the Add Two Numbers problem on LeetCode."
1012
---
1113

@@ -72,12 +74,19 @@ We iterate through both linked lists, adding corresponding node's values along w
7274

7375
```mermaid
7476
flowchart TD
75-
A[Start] --> B{l1 or l2 or carry}
76-
B --> |Yes| C[Add values of l1, l2, and carry]
77-
C --> D[Calculate new carry and current node value]
78-
D --> E[Add node with value to result list]
79-
E --> F{Move to next node in l1 and l2 if exist}
80-
F --> |Next nodes exist| G{l1 or l2 or carry}
77+
A[Start] --> B{l1 or l2
78+
or carry}
79+
B --> |Yes| C[Add values of l1, l2,
80+
and carry]
81+
C --> D[Calculate new carry and
82+
current node value]
83+
D --> E[Add node with value
84+
to result list]
85+
E --> F{Move to next
86+
node in l1 and
87+
l2 if exist}
88+
F --> |Next nodes exist| G{l1 or l2
89+
or carry}
8190
G --> |Yes| C
8291
G --> |No| H[Return result list]
8392
F --> |Next nodes do not exist| H

0 commit comments

Comments
 (0)