Wrong test case ? Not a complete circuit


#1

For given test case -

A : [ 1, 2, 3, 4, 5 ]
B : [ 3, 4, 5, 1, 2 ]

my code giving output -1 as it is not completing 1 circuit. Test case output is 3 which I think wrong as it is not allow us to complete one circuit


#2

you must be missing the equality sign while checking the condition