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

@@ -23,6 +23,19 @@ sidebar:
- `1 <= arr.length <= 1000`
- `0 <= arr[i] <= 1000`
## Approach
```mermaid
flowchart TD
S(["countElements(arr)"]) --> I["arrSet = Set(arr), count = 0"]
I --> L{"more n in arr?"}
L -- no --> E(["return count"])
L -- yes --> H{"arrSet has n + 1?"}
H -- yes --> C["count++"]
C --> L
H -- no --> L
```
## Solution
```js