Skip to content

Instantly share code, notes, and snippets.

@motatoes
Created October 9, 2019 22:34
Show Gist options
  • Save motatoes/e76822ff0f64c4aa4ffb8ea58f4d8e84 to your computer and use it in GitHub Desktop.
Save motatoes/e76822ff0f64c4aa4ffb8ea58f4d8e84 to your computer and use it in GitHub Desktop.
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