# Help me in solving KEEPOUT problem

### My issue

I have written the correct logic but I am unable to get the correct answer-
"ef max_consecutive_Difference_In_Array_Elements(arr):
#arr is atleast of length 2
maxdiff=arr[1]-arr[0]
for i in range(1,len(arr)-1):
diff=arr[i+1]-arr[i]
maxdiff=max(diff,maxdiff)
return maxdiff

t=int(input())
for i in range(t):
n,m=list(map(int,input().split()))
lst=list(map(int,input().split()))
for i in range(1,len(lst)-2):
val=max_consecutive_Difference_In_Array_Elements(lst[0:i+1]+lst[len(lst)-1:])
print(val,end=" ")
print()
"

### My code

``````def max_consecutive_Difference_In_Array_Elements(arr):
#arr is atleast of length 2
maxdiff=arr[1]-arr[0]
for i in range(1,len(arr)-1):
diff=arr[i+1]-arr[i]
maxdiff=max(diff,maxdiff)
return maxdiff

t=int(input())
for i in range(t):
n,m=list(map(int,input().split()))
lst=list(map(int,input().split()))
for i in range(1,len(lst)-2):
val=max_consecutive_Difference_In_Array_Elements(lst[0:i+1]+lst[len(lst)-1:])
print(val,end=" ")
print()

"""val=max_consecutive_Difference_In_Array_Elements(lst[0:i+1]+lst[len(lst)-1])
TypeError: can only concatenate list (not "int") to list"""
``````

Problem Link: KEEPOUT Problem - CodeChef