[–] arihersh 13y ago ↗ This is a very cool tool, @spicavigo! I look forward to using it in recruiting.
[–] shadykiller 13y ago ↗ Here's a 1 liner port in ruby :(l = ->(n,s=',o=0,c=0){ puts s and return if s.length == n || l.call(n,s+')',o,c+1) || o<n/2 && l.call(n,s+'(',o+1,c) if o>=c }).call(6) [–] spicavigo 13y ago ↗ Shame on you!
3 comments
[ 2.6 ms ] story [ 10.5 ms ] thread(l = ->(n,s=',o=0,c=0){ puts s and return if s.length == n || l.call(n,s+')',o,c+1) || o<n/2 && l.call(n,s+'(',o+1,c) if o>=c }).call(6)