Skip to content

Instantly share code, notes, and snippets.

@Awlter
Created March 15, 2020 10:06
Show Gist options
  • Save Awlter/4a43aaa0211202275477b08e097f3de9 to your computer and use it in GitHub Desktop.
Save Awlter/4a43aaa0211202275477b08e097f3de9 to your computer and use it in GitHub Desktop.
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