Skip to content

Commit cb9b5df

Browse files
committed
Solve 1548 - Canteen Queue in python
1 parent 55430b3 commit cb9b5df

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

solutions/beecrowd/1548/1548.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import sys
2+
3+
input = sys.stdin.readline
4+
output = sys.stdout.write
5+
6+
n = int(input())
7+
8+
for _ in range(n):
9+
_ = input()
10+
queue = list(map(int, input().split()))
11+
12+
count = 0
13+
for q, q_sorted in zip(queue[::-1], sorted(queue)):
14+
if q == q_sorted:
15+
count += 1
16+
17+
output(f'{count}\n')

0 commit comments

Comments
 (0)