class hello:... class world:... class A:... class a:... def cursed_world(): space = chr(ord(a.__name__) - ord(A.__name__)) return hello.__name__ + space + world.__name__import randomimport string- class hello:...
- class world:...
- class A:...
- class a:...
- def cursed_world():
target = "hello world"letters = [random.choice(string.ascii_lowercase + ' ') for _ in range(11)]generation = 0while True:generation += 1score = sum(letters[i] == target[i] for i in range(11))if score == 11:return "".join(letters)new_letters = letters[:]for i in range(11):if new_letters[i] != target[i]:if random.random() < 0.3:new_letters[i] = random.choice(string.ascii_lowercase + ' ')letters = new_letters- space = chr(ord(a.__name__) - ord(A.__name__))
- return hello.__name__ + space + world.__name__
One can just count how many of each letter and union with the minimum letter value.