-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Python 104 #57
base: master
Are you sure you want to change the base?
Python 104 #57
Conversation
@@ -0,0 +1,14 @@ | |||
import math | |||
|
|||
pand2 = lambda x: '0' not in x and len(set(x)) == 9 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔝
import math | ||
|
||
pand2 = lambda x: '0' not in x and len(set(x)) == 9 | ||
pand1 = lambda x: x % 3 == 0 and pand2(str(x)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cannot simply pass as a set to pand2
? Like pand2(set(x))
and there we do the same thing, but without a string comparison.
What do you think? (:
fb21135
to
5f2c6c5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, @murilocamargos.
Thank you for this contribution. This is a hard one!
Can you just check the CONTRIBUTING file to meet the standards for Python?
We're trying to keep a pattern for better comparison between languages :)
a9fcab8
to
aae4df4
Compare
87d4889
to
01bc663
Compare
4d4bab9
to
d533539
Compare
7521a47
to
c86e864
Compare
2791cd8
to
6684343
Compare
1710f7e
to
d2163af
Compare
e627ccd
to
7342761
Compare
How the solution works
This is a brute force solution with two optimizations:
Performance
Python 3