Skip to content

Instantly share code, notes, and snippets.

@abidkhan484
Created February 12, 2018 16:23
Show Gist options
  • Select an option

  • Save abidkhan484/57ab533af8844557e9b04fe65adae851 to your computer and use it in GitHub Desktop.

Select an option

Save abidkhan484/57ab533af8844557e9b04fe65adae851 to your computer and use it in GitHub Desktop.
for nothing in range(int(input().strip())):
n, first = map(int, input().split())
sec = first
for _ in range(n):
d = input().split()
if d[0]=='P':
first = sec
sec = d[1]
elif d[0]=='B':
sec, first = first, sec
print('Player', sec)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment