작성
·
210
0
from collections import deque
n,m = map(int, input().split())
data = list(map(int, input().split()))
data = deque(data)
cnt = 0
check = True
data[m] = str(data[m])
find = data[m]
while data:
tmp = data.popleft()
for i in data:
if int(i) > int(tmp):
data.append(tmp)
break
else:
cnt += 1
if tmp == find:
check = False
if check == False:
break
print(cnt)
m에대한 값만 str로 바꾸어 해결하였습니다!