I was trying to solve Lecandy problem and I completed that problem in 0.03s and used up 17.3 mb space. Any suggestions on improving the code? I have used python3.
Here’s the link to the problem:-
Here’s my solution:-
if c >= sum(a):
t = int(input())
ans = 
for i in range(1, t+1):
n, c = map(int, input().split())
a = 
a = list(map(int, input().split()))
if len(ans) != 0:
for i in ans:
Any help is greatly appreciated.