Created
December 25, 2020 19:22
-
-
Save hyperneutrino/56d301edbbad13811d1770acbe11bc87 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
| def jrange(x, y): | |
| return list(range(x, y + 1)) | |
| CurrLen = 8 | |
| def Find(): | |
| global CurrLen | |
| NotA = [chr(i) for i in jrange(9, 13) + jrange(32, 60) + jrange(62, 126)] | |
| A = "a" # 61 | |
| Ans = [] | |
| C = list(A * 8) | |
| Output = lambda x: Ans.append("".join(x)) | |
| def Edit2(): | |
| for Pos1 in jrange(1, CurrLen - 1): | |
| for Pos2 in jrange(Pos1 + 1, CurrLen): | |
| for Char1 in NotA: | |
| C[Pos1 - 1] = Char1 | |
| for Char2 in NotA: | |
| C[Pos2 - 1] = Char2 | |
| Output(C) | |
| C[Pos1 - 1] = C[Pos2 - 1] = A | |
| def Edit1(): | |
| for Pos in jrange(1, CurrLen): | |
| for Char in NotA: | |
| C[Pos - 1] = Char | |
| Output(C) | |
| C[Pos - 1] = A | |
| def AddA(): | |
| global CurrLen | |
| CurrLen += 1 | |
| C.append(A) | |
| Output(C) | |
| AddA() | |
| Edit1() | |
| Output(C) | |
| for Tmp in jrange(10, 12): | |
| AddA() | |
| Edit2() | |
| Edit1() | |
| Output(C) | |
| return Ans | |
| print(Find()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment