Blyx Nest Blyx language
Registry / Library
library · v0.1.1

Majority Index

Find an index containing a strict majority using cancellation and a verification pass. Return minus one if none exists.

Source repository · Package JSON

Use Majority Index

use vendor::majority_index::majority_index;

Run the example

nest demo majority_index@0.1.1
blyxc native-run majority_index-demo/main.blyx
Example source and expected output
use vendor::majority_index::majority_index;

fn main() {
    println!(majority_index([7,7,2]));
}

Expected output

0

Published versions

VersionPackageSource commitSHA-256
0.1.1Download ZIP · Browse filesc3a034d38137ea819516dda9bf39d2683b07b6f593a79f6319a2f51fac43cce22a9900de5b
0.1.0Download ZIP · Browse files6349f23784add1e26310a60d488789dae49ae5aa93dd5b12e9979b0ddd1cc02634f7b9512e