Registry / Library

library · v0.1.1
Balance Index
Find the first index where the sum of earlier values equals the sum of later values. Return minus one if none exists.
Use Balance Index
use vendor::balance_index::balance_index;
Run the example
nest demo balance_index@0.1.1
blyxc native-run balance_index-demo/main.blyx
Example source and expected output
use vendor::balance_index::balance_index;
fn main() {
println!(balance_index([1,7,3,6,5,6]));
}
Expected output
3
Published versions
| Version | Package | Source commit | SHA-256 |
|---|---|---|---|
| 0.1.1 | Download ZIP · Browse files | d45e1a61d2 | 2953e89481b63e6d00a12a0f54a37fddbb1fb1fe16c91134cd2a348ed7136c81 |
| 0.1.0 | Download ZIP · Browse files | 6349f23784 | e9df1a5924ef175771fca6dd25b2508bb3e8c10bf8df06a77272fed8465f65be |