mirror of
https://github.com/Xevion/leetcode.git
synced 2025-12-06 07:15:22 -06:00
Commit left over comments on two-pointers Rust solution
This commit is contained in:
@@ -5,6 +5,8 @@ impl Solution {
|
|||||||
let (a_length, b_length) = (a.len(), b.len());
|
let (a_length, b_length) = (a.len(), b.len());
|
||||||
let (mut a_pointer, mut b_pointer, mut current, mut previous) = (0, 0, 0, 0);
|
let (mut a_pointer, mut b_pointer, mut current, mut previous) = (0, 0, 0, 0);
|
||||||
|
|
||||||
|
// Iterate until middle + 1 [1, 2, 3, 4] => arr[2]
|
||||||
|
// On even length arrays, we need the previous value to calculate the median
|
||||||
for _ in 0..=((a_length+b_length)/2) {
|
for _ in 0..=((a_length+b_length)/2) {
|
||||||
previous = current;
|
previous = current;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user