第二个测试点不对啊,奇怪
查看原帖
第二个测试点不对啊,奇怪
596772
suxiaorui楼主2021/12/9 21:27
def isprime(num):
    if num < 2:
        return False
    i = 2
    while i <= num/i:
        if i % 2 == 0:
            return False
        i += 1
    return True
s = input()
hash_map = {}
for i in s:
    if i not in hash_map:
        hash_map[i] = 1
    else:
        hash_map[i] += 1
num = max(hash_map.values()) - min(hash_map.values())
if isprime(num):
    print("Lucky Word")
    print(num)
else:
    print("No Answer")
    print(0)
2021/12/9 21:27
加载中...