My issue
The code I entered is correct since the answers were correct when I gave different outputs, but I don’t know what’s the issue. while submitting it says, it is wrong
My code
t = int(input())
for _ in range(t):
n, m = map(int, input().split())
idli_list = list(map(int, input().split()))
# Update your code below this line
idli_list.sort()
idli_list.reverse()
count=0;i=0
while m>0 and i<n:
if m>=idli_list[i]:
m-=idli_list[i]
count+=1
i+=1
print(count)
Learning course: Kalasalingam Academy of Research and Education
Problem Link: CodeChef: Practical coding for everyone