← Back to List

27627번: Splitology ↗

Solutions

Python 3
172 B | 172 chars
s = input()
n = len(s)

for i in range(1, n):
    a = s[:i]
    b = s[i:]
    
    if a == a[::-1] and b == b[::-1]:
        print(a, b)
        break
else:
    print("NO")