Problem 981. Find nearest prime number less than input number
解决方案统计
问题评论
-
6条评论
@bmtran (Bryant Tran)2012年10月10日
1 isn't a prime number
Disha2013年7月31日
agree @bmtran...
Grzegorz Knor2013年9月20日
您应该更正测试套件。1不是素数。
Vishal2014年10月6日
更正测试套件1不是质数。
Daniel Pereira2016年5月6日
1不是素数,以实现算术的基本定理:
https://en.wikipedia.org/wiki/fundamental_theorem_of_arithmetic
https://en.wikipedia.org/wiki/prime_number#primality_of_one
约翰·德·埃里里科(John D'Errico)2018年2月22日
I removed the test case where n==2, since 1 is indeed not a prime number. I also added a random test case, so the problem is not so easily cooked by knowing all the test cases.
解决方案评论
-
1条评论
yinghui li2017年8月1日
好吧,我认为1号不是素数,但我需要通过测试。因此,由于您有1个,我会徘徊所有正确的答案,因为您有1个。
-
1条评论
eggarton 2 Mar 2016
恕我直言1不是素数,因此在输入n = 2上,正确的答案应为[]而不是1。
-
1条评论
小崛Takehikoon 4 Oct 2015
これで正しいだろ。
-
2条评论