Check my submissions don’t know what’s wrong…
My submissions
help me out:))
Hello,
On a first glance, I see two things:
and
Hope this helps,
Bruno
from sys import stdin,stdout
from collections import deque
def main():
new_line=deque()
line=stdin.readline().split()
while int(line[0]) != 0:
for i in line:
new_line.append(int(i))
gab=new_line.popleft()
highest_number=max(new_line)
new_line.remove(highest_number)
sum_two_sides=0
count=0
j=0
while j<=len(new_line):
sum_two_sides=new_line(j)+new_line(j+1)
if sum_two_sides > highest_number:
count=count+1
j=j-1
line=stdin.readline().split()
print(count)
main()
What about this one…?
---------> j=0
----------> while j<=len(new_line):
sum_two_sides=new_line(j)+new_line(j+1)
if sum_two_sides > highest_number:
count=count+1
---------->j=j-1
line=stdin.readline().split()
print(count)
On the lines I signaled with an arrow, I believe that this while loop is not correct, since I am also assuming that the lenght of a line is at least a positive integer…
Maybe this can be one of your problems?
Bruno