Created
October 9, 2019 22:34
-
-
Save motatoes/e76822ff0f64c4aa4ffb8ea58f4d8e84 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
def valid(n): | |
return len(set(str(n))) == len(str(n)) | |
a,b = list(map(int,input().split())) | |
for i in range(a,b+1): | |
if valid(i): | |
print(i) | |
sys.exit(0) | |
print(-1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment