Task:

 Generate a string with   N   opening brackets   [   and with   N   closing brackets   ],   in some arbitrary order. 
 Determine whether the generated string is balanced; that is, whether it consists entirely of pairs of opening/closing brackets (in that order), none of which mis-nest.


Examples

   (empty)      OK
   []           OK   
   [][]         OK   
   [[][]]       OK 
   ][         NOT OK
   ][][       NOT OK
   []][[]     NOT OK



dim brk$(10)
brk$(1)  = "[[[][]]]"           
brk$(2)  = "[[[]][[[][[][]]]]]" 
brk$(3)  = "][][]][["           
brk$(4)  = "[][][]"             
brk$(5)  = "[][]][]][[]]][[["   
brk$(6)  = "]][[[[]]]][]]][[[[" 
brk$(7)  = "[[][[[]]][]]"       
brk$(8)  = "[]][][][[[]]"       
brk$(9)  = "][]][["             
brk$(10) = "[]][][][[]"         
 
for i = 0 to 10
  b$ = brk$(i)
  while instr(b$,"[]") <> 0
    x = instr(b$,"[]")
    if x > 0 then b$ = left$(b$,x - 1) + mid$(b$,x + 2)
  wend
  if trim$(b$) = "" then print "    OK "; else print "Not OK ";
  print brk$(i)
next i