← Back to List

17201번: 자석 체인 ↗

Solutions

Python 3
146 B | 146 chars
n=input()
a=list(input())
for i in range(1,len(a)//2):
    if a[(i-1) * 2 + 1 ]== a[i*2]:
        print("No")
        break
else:
    print("Yes")