Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,24 @@
isBalanced: function [s][
cnt: 0
loop split s [ch][
if? ch="]" [
cnt: cnt-1
if cnt<0 -> return false
]
else [
if ch="[" -> cnt: cnt+1
]
]
cnt=0
]
loop 1..10 'i [
str: join map 0..(2*i)-1 [x][ sample ["[" "]"]]
prints str
if? isBalanced str -> print " OK"
else -> print " Not OK"
]