Data update
This commit is contained in:
parent
5150844a7d
commit
4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions
|
|
@ -1,11 +1,11 @@
|
|||
def gen_brackets [n: int] { 1..$in | each {["[" "]"]} | flatten | shuffle | str join }
|
||||
|
||||
def check_brackets [] {
|
||||
split chars | reduce --fold 0 {|x, d|
|
||||
if ($d < 0) {-1} else {
|
||||
$d + (if ($x == "[") {1} else {-1})
|
||||
}
|
||||
} | $in > -1
|
||||
split chars | reduce --fold 0 {|x, d|
|
||||
if ($d < 0) {-1} else {
|
||||
$d + (if ($x == "[") {1} else {-1})
|
||||
}
|
||||
} | $in > -1
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue