Skip to content

Commit f5d4664

Browse files
Fix: Add JavaScript solution for problem 2627 and remove unnecessary image placeholders from explanations
1 parent f304484 commit f5d4664

File tree

14 files changed

+24
-39
lines changed

14 files changed

+24
-39
lines changed

explanations/1038/en.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
**High-level approach**
1313
We perform a reverse inorder traversal (right, root, left) of the BST. This visits nodes in descending order. As we traverse, we accumulate the sum of all values we've seen and update each node's value to be the sum of itself and all greater values.
1414

15-
![BST with reverse inorder traversal showing cumulative sum updates]
16-
1715
**Brute force vs. optimized strategy**
1816

1917
* **Brute Force:** Collect all values, sort them, and update nodes - but this requires extra space.

explanations/1769/en.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
**High-level approach**
1313
For each target position, we calculate the total number of operations needed to move all balls from their current positions to that target. Each ball requires `abs(target_position - current_position)` operations to move.
1414

15-
![Visualization showing balls moving from their positions to a target box]
16-
1715
**Brute force vs. optimized strategy**
1816

1917
* **Brute Force:** For each position, iterate through all boxes and sum the distances. This is O(n²) which is acceptable for n ≤ 2000.

explanations/1828/en.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
**High-level approach**
1313
For each query circle, we check all points to see if they're inside the circle. A point is inside if the distance from the point to the circle center is less than or equal to the radius.
1414

15-
![Circle with points inside and outside, showing distance calculations]
16-
1715
**Brute force vs. optimized strategy**
1816

1917
* **Brute Force:** For each query, check all points - this is O(q * p) which is acceptable for the given constraints.

explanations/2044/en.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
**High-level approach**
1313
The maximum possible bitwise OR is achieved by taking the OR of all elements. We generate all non-empty subsets and count how many have this maximum OR value.
1414

15-
![Visualization showing subsets and their bitwise OR values]
16-
1715
**Brute force vs. optimized strategy**
1816

1917
* **Brute Force:** Generate all subsets using bitmasks and check their OR values - this is what we do, and it's efficient for n ≤ 16.

explanations/2125/en.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
**High-level approach**
1313
We count security devices in each row, skip empty rows, and calculate beams between adjacent non-empty rows. The number of beams between two rows equals the product of device counts in those rows.
1414

15-
![Bank floor plan showing laser beams between security devices in different rows]
16-
1715
**Brute force vs. optimized strategy**
1816

1917
* **Brute Force:** For each device pair, check if there's a clear path - this is O(m² * n²).

explanations/2161/en.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
**High-level approach**
1313
We partition the array into three groups: elements less than pivot, elements equal to pivot, and elements greater than pivot. We maintain the relative order within each group, then combine them.
1414

15-
![Array partitioning into three groups: less, equal, greater than pivot]
16-
1715
**Brute force vs. optimized strategy**
1816

1917
* **Brute Force:** Sort the array - but this doesn't maintain relative order of elements within groups.

explanations/2181/en.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
**High-level approach**
1313
We traverse the linked list, summing values between consecutive zero nodes. Each sum becomes a new node in the result list, and we skip the zero nodes.
1414

15-
![Linked list showing nodes between zeros being merged into single nodes]
16-
1715
**Brute force vs. optimized strategy**
1816

1917
* **Brute Force:** Create a new list by collecting values between zeros - this is what we do, and it's optimal.

explanations/2265/en.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
**High-level approach**
1313
We perform a post-order DFS traversal. For each node, we calculate the sum and count of its subtree, compute the average, and check if the node's value equals this average.
1414

15-
![Binary tree showing subtree sums and averages at each node]
16-
1715
**Brute force vs. optimized strategy**
1816

1917
* **Brute Force:** For each node, separately calculate subtree sum and count - but this would cause redundant calculations.

explanations/239/en.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
**High-level approach**
1313
We use a deque (double-ended queue) to maintain indices of elements in decreasing order. As we slide the window, we remove indices outside the window and indices whose values are smaller than the current element.
1414

15-
![Sliding window with deque maintaining maximum elements]
16-
1715
**Brute force vs. optimized strategy**
1816

1917
* **Brute Force:** For each window position, scan all k elements to find the maximum. This is O(n*k).

explanations/2433/en.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
**High-level approach**
1313
Given that `pref[i] = arr[0] ^ arr[1] ^ ... ^ arr[i]`, we can recover `arr[i]` using the property that `pref[i] = pref[i-1] ^ arr[i]`, which means `arr[i] = pref[i] ^ pref[i-1]`.
1414

15-
![XOR prefix array showing how to recover original values]
16-
1715
**Brute force vs. optimized strategy**
1816

1917
* **Brute Force:** Try all possible values for each position - this is exponential and inefficient.

0 commit comments

Comments
 (0)