Created
March 15, 2020 10:06
-
-
Save Awlter/4a43aaa0211202275477b08e097f3de9 to your computer and use it in GitHub Desktop.
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
class Solution: | |
def minMutation(self, start: str, end: str, bank: List[str]) -> int: | |
result = 0 | |
if end in bank: | |
for i in range(len(start)): | |
if start[i] != end[i]: | |
result += 1 | |
return -1 if result == 0 else result | |
# why 下面的测试会挂掉 | |
"AACCTTGG" | |
"AATTCCGG" | |
["AATTCCGG","AACCTGGG","AACCCCGG","AACCTACC"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment