Blyx Nest Blyx language
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.

Source repository · Package JSON

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

VersionPackageSource commitSHA-256
0.1.1Download ZIP · Browse filesd45e1a61d22953e89481b63e6d00a12a0f54a37fddbb1fb1fe16c91134cd2a348ed7136c81
0.1.0Download ZIP · Browse files6349f23784e9df1a5924ef175771fca6dd25b2508bb3e8c10bf8df06a77272fed8465f65be