My issue
In Example Case 1, why is [2,3] not a subarray ?
My code
# cook your dish here
for i in range(int(input())):
n=int(input())
l=list(map(int,input().split()))
d=[]
l.sort()
for j in range(n):
d.append([l[j],l[j]])
for k in range(i+1,n):
if l[k]>=l[j] and abs(l[j]-l[k])==1:
d.append([l[j],l[k]])
print(d)
print(len(d))
Learning course: Dynamic programming
Problem Link: CodeChef: Practical coding for everyone