Parenthesis Permutation: In 7 lines of Python Posted by spicavigo on Tuesday April 23, 2013 @01:37PM from the codebunk.com dept. http://codebunk.com/bunk#-IsrtQcv125Udslem2wL ( 3 comments | 3 points | on HN )
(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)