×

# Deputy Chef problem in Beginner section facing runtime Error

 0 Hi all, I am facing a runtime error for my code of Deputy chef problem in beginner section.Kindly have a look at my code, it shows successfully executed for the test cases, but when I submit it shows runtime Error. Here is my code: t=int(input('Enter test cases: ')) while(t!=0): n=int(input('Enter people in the formation: ')) a,d=[],[] a=list(map(int,input('Enter attack value: ').split())) d=list(map(int,input('Enter Defense value: ').split())) sum=[] zeroth=int(a[1]+a[len(a)-1]) sum.append(zeroth) for i in range(1,len(a)-1): p=0 p=a[i-1]+a[i+1] sum.append(p) last=int(a[len(a)-2]+a[0]) sum.append(last) q=[i - j for i, j in zip(d,sum)] r=max(q) if(r<=0): print(-1) else: print(d[q.index(max(q))]) t-=1 asked 14 Mar, 15:43 1●1 accept rate: 0% Share a link to your submission. (18 Mar, 17:03)
 toggle preview community wiki:
Preview

By Email:

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• image?![alt text](/path/img.jpg "title")
• numbered list: 1. Foo 2. Bar
• to add a line break simply add two spaces to where you would like the new line to be.
• basic HTML tags are also supported
• mathemetical formulas in Latex between \$ symbol

Question tags:

×280