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

Bracket Depth

Check a stream encoded as plus one for open and minus one for close and return maximum balanced nesting. Reject premature closes and unfinished groups.

Source repository · Package JSON

Use Bracket Depth

use vendor::bracket_depth::bracket_depth;

Run the example

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

fn main() {
    println!(bracket_depth([1,1,-1,-1]));
}

Expected output

2

Published versions

VersionPackageSource commitSHA-256
0.1.1Download ZIP · Browse filesde43954290a19e35561fbec3d691981130a1f25d82ecdfcb13f1b78b252afc7fc3a87410ae
0.1.0Download ZIP · Browse files6349f23784fbb162440b5ec29782283886d67be76f0f86a68a0bddee7dc51a5a3b5d24f997