sub Ȧ {?$_&&!$_».List.flat».List.flat.grep: *==0}
for (True => [
[1,], [10,], [[,],], [[[[1,],],],], [[], [1], [1, 2]],
[[1], [1, [2]], [1, [2, [3]]]], [[8], [8, [9]], [8, [9, [10]]]]
],
False => [
[,], [0,], [0, -1], [-1, 0], [[[[0,],],],], [[0,], [1, 2], [3, 4, 5]],
[[8,], [8, [9]], [8, [9, [1, 0]]]], [-1, 0, 0, 0]
]).Hash.kv -> $expected, @tests {
say "Expected: $expected";
for @tests -> @list {
say "\t{@list.raku} -> {Ȧ(@list)}"
}
}