docs(docs): add Approach and Explanation sections with mermaid diagrams to problem pages

This commit is contained in:
Prad Nukala committed 2026-09-01 14:21:54 -04:00
1 parent e59d78e571
commit a86d72c7db
43 files changed
+812

No files matched your search

@@ -27,6 +27,17 @@ sidebar:
- `1 <= nums.length <= 1000`
- `-10^6 <= nums[i] <= 10^6`
## Approach
```mermaid
flowchart TD
S(["runningSum(nums)"]) --> I["prefix = [nums[0]]"]
I --> L{"more i in 1..n-1?"}
L -- yes --> P["prefix.push(prefix[i-1] + nums[i])"]
P --> L
L -- no --> E(["return prefix"])
```
## Solution
```js