Last active
June 26, 2017 14:14
-
-
Save AvocadosConstant/eff3525643d012859cdd81411ce9efea to your computer and use it in GitHub Desktop.
Solution to http://100.70.19.162:8000/contest/32/11
This file contains 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 | |
""" | |
Solution to http://100.70.19.162:8000/contest/32/11 | |
""" | |
def check_friendly(s, l): | |
if (len(s) == len(l) and sum(s[i] != l[i] for i in range(len(s))) <= 1 | |
or len(s) == len(l) - 1 and s == l[:-1] | |
or len(s) == len(l) + 1 and s[:-1] == l): | |
return 'TRUE' | |
return('FALSE') | |
data = sys.stdin.read().splitlines() | |
print(check_friendly(data[0], data[1])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment