Finding the error why it is not accepted

t=int(input())
for i in range(t):
k=int(input())
a=list(map(int,input().split()))
count1=0
count2=len(a)
for i in range(0,len(a)-1):
if (a[i+1]-a[i])<=2:
count1+=1

    else:
        count2+=1
        break
b=int(count1+1)
if len(a)!=b:
    c=int(len(a)-b)
else:
    c=b

print("%d %d" %(b,c))

Format your code and also what question are you solving?

1 Like