본문 바로가기
Beakjoon&프로그래머스/파이썬

[백준/파이썬] 24073번 ビ太郎と IOI (Bitaro and IOI)

by 현장 2023. 7. 7.

-Code

n = int(input())
s = input()
ioi = "IOI"
position = 0

for w in s:
    if w == ioi[position]:
        position += 1
    if position == 3:
        break

print("Yes" if position == 3 else "No")