← Back to List

27541번: 末尾の文字 (Last Letter) ↗

Solutions

Python 3
78 B | 78 chars
input()
s = input()

if s[-1] == "G":
    print(s[:-1])
else:
    print(s+"G")