import sys
def black_card(test):
arr = test.split(" | ")
n = int(arr[1])
valz = arr[0].split()
while len(valz) > 1:
valz.pop((n%len(valz))-1)
return valz.pop()
test_cases = open(sys.argv[1], 'r')
for test in test_cases:
print black_card(test)
test_cases.close()
def black_card(test):
arr = test.split(" | ")
n = int(arr[1])
valz = arr[0].split()
while len(valz) > 1:
valz.pop((n%len(valz))-1)
return valz.pop()
test_cases = open(sys.argv[1], 'r')
for test in test_cases:
print black_card(test)
test_cases.close()
No comments:
Post a Comment