14
Last seen 2 years ago
Member for 11 years, 17 days
Difficulty Normal
Below is the original code.
Since 10 and 9 are relatively prime, N%10 and N%9 will be different for all N in 1~90.
On the other hand, the remanders will be same where N in 1~10 and N in 91~100.
def checkio(attempts):
A = attempts
if len(A)==1:
return (10
More
There is a shorter solution as below which is more clear I think ::
checkio=lambda S:any(a.endswith(b)for a in S for b in S-{a})
More
Finally...it's really difficult that pasting Whitespace code into CheckIO editor...||||orz
More