TE
科技回声
首页
24小时热榜
最新
最佳
问答
展示
工作
中文
GitHub
Twitter
首页
Regular Expression That Checks If a Number Is Prime (2016)
4 点
作者
jagtodeath
超过 5 年前
1 comment
jagtodeath
超过 5 年前
A python implementation of is_prime(n):<p><pre><code> return re.compile(r'^1?$|^(11+)\1+$').match('1' * n) is None</code></pre>