Jewel the Magician

Jewel is a promising magician. Recently, he has learned a technique to mesmerize his audience. Let’s…

Click here to read the complete problem statement.


If you need help solving this problem, mention your approach and ask specific questions. Please avoid sharing your code and asking the Community to figure out “what’s wrong”.

Need help to figer out my mistakes.

pos=list(map(int, input().split()))
counter=[0]*3

for _ in range(int(input())):
    for i in map(int, input().split()):
        i-=1
        pos[i]^=1
        counter[i]+=pos[i]

print(' '.join(map(str, counter)))

The answer is:

Read the initial positions (A, B, C)

line1 = input().split()
a = int(line1[0])
b = int(line1[1])
c = int(line1[2])

current_pos = 0
if a == 1:
current_pos = 1
elif b == 1:
current_pos = 2
else:
current_pos = 3

s = int(input())

count1 = 0
count2 = 0
count3 = 0

for _ in range(s):
swap = input().split()
p1 = int(swap[0])
p2 = int(swap[1])

if p1 == current_pos:
current_pos = p2
elif p2 == current_pos:
current_pos = p1

if current_pos == 1:
count1 += 1
elif current_pos == 2:
count2 += 1
elif current_pos == 3:
count3 += 1

print(count1, count2, count3)

I used basic python