My issue
I want to complete my week 12 as my laptop got problem and it’s in repair shop for past 7 days.Do please allow me to complete week 12
My code
# cook your dish here
for z in range(int(input())):
n = int(input())
w = [int(x) for x in input().split()]
l = [int(x) for x in input().split()]
m = min(w)
j = w.index(m)
c = 0
for x in sorted(w):
i = w.index(x)
if i > j or x == m:
j = i
continue
k = j - i + 1
if k % l[i] == 0:
c += k//l[i]
j += 1
else:
c += 1 + k//l[i]
j = i + (1+k//l[i])*l[i]
print(c)
Learning course: Kalasalingam Academy of Research and Education
Problem Link: CodeChef: Practical coding for everyone