-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathService lane.py
55 lines (44 loc) · 977 Bytes
/
Service lane.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
def serviceLane(width, cases):
# Write your code here
l=[]
for i in cases:
print()
l.append(min(width[i[0]:i[1]+1:]))
return l
if __name__ == '__main__':
first_multiple_input = input().rstrip().split()
n = int(first_multiple_input[0])
t = int(first_multiple_input[1])
width = list(map(int, input().rstrip().split()))
cases = []
for _ in range(t):
cases.append(list(map(int, input().rstrip().split())))
result = serviceLane(width, cases)
print('\n'.join(map(str, result)))
#print('\n')
'''
INPUT
5 5
1 2 2 2 1
2 3
1 4
2 4
2 4
2 3
my OUTPUT expected OUTPUT
2 2
2 1
2 1
2 1
2 2
'''
'''
def serviceLane(n, cases):
# Write your code here
#width=[2, 3, 1, 2, 3, 2, 3, 3]
for i in cases:
print(min(width[i[0]:i[1]:+1]))
n=8
cases = [[0, 3], [4, 6], [6, 7], [3, 5], [0, 7]]
serviceLane(n, cases)
'''