Add tasks for all the new languages
This commit is contained in:
parent
9dc3c2bb62
commit
bba7bfd280
13208 changed files with 134745 additions and 0 deletions
13
Task/Balanced-brackets/Swift/balanced-brackets-3.swift
Normal file
13
Task/Balanced-brackets/Swift/balanced-brackets-3.swift
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
func randBrack(n: Int) -> String {
|
||||
|
||||
var bracks: [Character] = Array(Repeat(count: n, repeatedValue: "["))
|
||||
|
||||
for i in UInt32(n+1)...UInt32(n + n) {
|
||||
|
||||
bracks.insert("]", atIndex: Int(arc4random_uniform(i)))
|
||||
|
||||
}
|
||||
|
||||
return String(bracks)
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue