Hi all,
Iam learning python, Some of my codes couldn’t, pass the second subtasks. I dont know why its happening, what should i learn? where i make mistakes?
Here’s my code for Chewing Gum problem which clears Subtask 1 but not 2nd!
Thanks in Advance…
N,K=map(int,input().split())
Hardness= list(map(int,input().split())) [:N]
count=0
for i in Hardness:
if i>=K:
Hardness.remove(i)
N=len(Hardness)
for i in range(0,N-1):
k=i+1
for j in range(k,N):
if(Hardness[i]+Hardness[j])<K:
count=count+1
print(count)