TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Parenthesis Permutation: In 7 lines of Python

3 pointsby spicavigoabout 12 years ago

2 comments

shadykillerabout 12 years ago
Here's a 1 liner port in ruby :<p>(l = -&#62;(n,s=',o=0,c=0){ puts s and return if s.length == n || l.call(n,s+')',o,c+1) || o&#60;n/2 &#38;&#38; l.call(n,s+'(',o+1,c) if o&#62;=c }).call(6)
评论 #5601106 未加载
arihershabout 12 years ago
This is a very cool tool, @spicavigo! I look forward to using it in recruiting.