// Find the first index where the sum of earlier values equals the sum of later values. Return minus one if none exists. pub fn balance_index(items: vector) -> i64 { let mut right = 0.0; let mut i = 0; while i