Skip to content

Commit a3264ee

Browse files
authored
Merge pull request #227 from 1chooo/fix/#225
Fix/#225
2 parents 16cae1c + c1e66c5 commit a3264ee

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

apps/web/src/components/markdown/code-block.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const CodeBlock: React.FC<CodeBlockProps> = ({ language, children }) => (
2424
wrapLines={true}
2525
showInlineLineNumbers={true}
2626
>
27-
{String(children)}
27+
{String(children).trimEnd()}
2828
</SyntaxHighlighter>
2929
);
3030

apps/web/src/contents/2181-merge-nodes-in-between-zeros.mdx apps/web/src/contents/2181-merge-nodes-in-between-zeros.md

+8-7
Original file line numberDiff line numberDiff line change
@@ -116,23 +116,23 @@ Take `head = [0, 3, 1, 0, 4, 5, 2, 0]` as an example, let's go through the code
116116
- `cur` points to the second node (value 3).
117117
- Since `cur.Val` is not 0, add `cur.Val` to `sum`:
118118

119-
```
119+
```go
120120
sum = 0 + 3 = 3
121121
```
122122

123123
### Iteration 2
124124
- Move `cur` to the third node (value 1).
125125
- Since `cur.Val` is not 0, add `cur.Val` to `sum`:
126126

127-
```
127+
```go
128128
sum = 3 + 1 = 4
129129
```
130130

131131
### Iteration 3
132132
- Move `cur` to the fourth node (value 0).
133133
- Since `cur.Val` is 0, update `n.Val` and move `n`:
134134

135-
```
135+
```go
136136
n.Val = sum = 4
137137
n.Next = cur.Next (points to node with value 4)
138138
sum = 0
@@ -144,36 +144,37 @@ Take `head = [0, 3, 1, 0, 4, 5, 2, 0]` as an example, let's go through the code
144144
- Move `cur` to the fifth node (value 4).
145145
- Since `cur.Val` is not 0, add `cur.Val` to `sum`:
146146

147-
```
147+
```go
148148
sum = 0 + 4 = 4
149149
```
150150

151151
### Iteration 5
152152
- Move `cur` to the sixth node (value 5).
153153
- Since `cur.Val` is not 0, add `cur.Val` to `sum`:
154154

155-
```
155+
```go
156156
sum = 4 + 5 = 9
157157
```
158158

159159
### Iteration 6
160160
- Move `cur` to the seventh node (value 2).
161161
- Since `cur.Val` is not 0, add `cur.Val` to `sum`:
162162

163-
```
163+
```go
164164
sum = 9 + 2 = 11
165165
```
166166

167167
### Iteration 7
168168
- Move `cur` to the eighth node (value 0).
169169
- Since `cur.Val` is 0, update `n.Val` and move `n`:
170170

171-
```
171+
```go
172172
n.Val = sum = 11
173173
n.Next = cur.Next (points to nil, end of the list)
174174
sum = 0
175175
n = cur.Next (points to nil)
176176
```
177+
177178
The linked list now looks like this: `[0, 4, 11]`
178179

179180
### End

0 commit comments

Comments
 (0)