👉🏻 5586번: JOI와 IOIs = input()count = 0for i in range(len(s)-1): if s[i] == 'I' and s[i+1] == 'O' and s[i+2] == 'I': count += 1 print(s.count('JOI'))print(count)'IOI' 같은 경우, 'IOIOI'와 같은 부분 문자열은 count() 함수로 세는 것에 제약이 있었습니다.따라서 반복문으로 'IOI'의 개수는 따로 계산하고,영향을 받지 않는 'JOI'는 count() 함수를 이용하여 계산하였습니다.
👉🏻 14696번: 딱지놀이import sys; input=sys.stdin.readlinedef compare(A, B, value): if A.count(value) != B.count(value): return 'A' if A.count(value) > B.count(value) else 'B' return Nonefor _ in range(int(input())): A = list(map(int, input().split()))[1:] B = list(map(int, input().split()))[1:] result = None for value in [4, 3, 2, 1]: result = compare(A, B, value)..