Skip to content

Instantly share code, notes, and snippets.

@Youngestdev
Created April 17, 2020 15:39
Show Gist options
  • Select an option

  • Save Youngestdev/a75a3daeeba1bb00514f5e675cdf9466 to your computer and use it in GitHub Desktop.

Select an option

Save Youngestdev/a75a3daeeba1bb00514f5e675cdf9466 to your computer and use it in GitHub Desktop.
Google Kickstart
T = int(input())
count = 0
f = 0
if T is None or T is 0:
pass
while f < T:
count += 1
n, b = map(int, input().split())
c = (input().split())
c = sorted(c)
ans = 0
for i in range(n):
if b >= int(c[i]):
ans += 1
b -= int(c[i])
print("Case #{}: {}".format(count, ans))
f += 1
@lilpolymath
Copy link
Copy Markdown

I still have a long way to go with competitive programming. I already started a course today sef.

@Youngestdev
Copy link
Copy Markdown
Author

Oh, where? I no sabi C++ but then Python is too slow for competitive programming.

@Youngestdev
Copy link
Copy Markdown
Author

What language do you intend to use? We might learn - I remember we planned to jump into it together lol

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment