new files
This commit is contained in:
parent
3af7344581
commit
86c034bb8b
1364 changed files with 21352 additions and 0 deletions
8
Task/Balanced-brackets/Tcl/balanced-brackets-2.tcl
Normal file
8
Task/Balanced-brackets/Tcl/balanced-brackets-2.tcl
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
proc constructBalancedString {n} {
|
||||
set s ""
|
||||
for {set i 0} {$i < $n} {incr i} {
|
||||
set x [expr {int(rand() * ([string length $s] + 1))}]
|
||||
set s "[string range $s 0 [expr {$x-1}]]\[\][string range $s $x end]"
|
||||
}
|
||||
return $s
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue