Skip to content

Commit fcf371d

Browse files
committed
Improved 3427
1 parent 8c1f652 commit fcf371d

File tree

1 file changed

+15
-59
lines changed
  • src/main/java/g3401_3500/s3427_sum_of_variable_length_subarrays

1 file changed

+15
-59
lines changed

src/main/java/g3401_3500/s3427_sum_of_variable_length_subarrays/readme.md

Lines changed: 15 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -14,33 +14,12 @@ Return the total sum of all elements from the subarray defined for each index in
1414

1515
**Explanation:**
1616

17-
i
18-
19-
Subarray
20-
21-
Sum
22-
23-
0
24-
25-
`nums[0] = [2]`
26-
27-
2
28-
29-
1
30-
31-
`nums[0 ... 1] = [2, 3]`
32-
33-
5
34-
35-
2
36-
37-
`nums[1 ... 2] = [3, 1]`
38-
39-
4
40-
41-
**Total Sum**
42-
43-
11
17+
| i | Subarray | Sum |
18+
|-----|------------------------------|-----|
19+
| 0 | `nums[0] = [2]` | 2 |
20+
| 1 | `nums[0 ... 1] = [2, 3]` | 5 |
21+
| 2 | `nums[1 ... 2] = [3, 1]` | 4 |
22+
| **Total Sum** | | 11 |
4423

4524
The total sum is 11. Hence, 11 is the output.
4625

@@ -52,40 +31,17 @@ The total sum is 11. Hence, 11 is the output.
5231

5332
**Explanation:**
5433

55-
i
56-
57-
Subarray
58-
59-
Sum
60-
61-
0
62-
63-
`nums[0] = [3]`
64-
65-
3
66-
67-
1
68-
69-
`nums[0 ... 1] = [3, 1]`
70-
71-
4
72-
73-
2
74-
75-
`nums[1 ... 2] = [1, 1]`
76-
77-
2
78-
79-
3
80-
81-
`nums[1 ... 3] = [1, 1, 2]`
82-
83-
4
84-
85-
**Total Sum**
34+
Here's the HTML table converted to Markdown:
8635

87-
13
36+
| i | Subarray | Sum |
37+
|-----|------------------------------|-----|
38+
| 0 | `nums[0] = [3]` | 3 |
39+
| 1 | `nums[0 ... 1] = [3, 1]` | 4 |
40+
| 2 | `nums[1 ... 2] = [1, 1]` | 2 |
41+
| 3 | `nums[1 ... 3] = [1, 1, 2]` | 4 |
42+
| **Total Sum** | | 13 |
8843

44+
This Markdown table replicates the structure and content of the original HTML table.
8945
The total sum is 13. Hence, 13 is the output.
9046

9147
**Constraints:**

0 commit comments

Comments
 (0)