Skip to content

Instantly share code, notes, and snippets.

@andriiburka
Created February 3, 2020 16:56
Show Gist options
  • Save andriiburka/cf72ccd94f277270177ab23fb18bf0f5 to your computer and use it in GitHub Desktop.
Save andriiburka/cf72ccd94f277270177ab23fb18bf0f5 to your computer and use it in GitHub Desktop.
60/100 why???
str_in = map(str, input().split())
max_players = 11
team_a = []
team_b = []
for player in range(1, max_players + 1):
team_a.append(str(player))
team_b.append(str(player))
a_counter = max_players
b_counter = max_players
for el in str_in:
if (a_counter or b_counter) < 7:
break
elif el[0] == 'A':
a_counter -= 1
a_remover = el.replace('A-', '')
if a_remover in team_a:
team_a.remove(a_remover)
elif el[0] == 'B':
b_counter -= 1
b_remover = el.replace('B-', '')
if b_remover in team_b:
team_b.remove(b_remover)
print(f'Team A - {a_counter}; Team B - {b_counter}', )
if (a_counter or b_counter) < 7:
print('Game was terminated')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment