Weak testcases one of them is mentioned below


#1

Weak testcases.
for
4
4 1 2 3 4
4 2 3 4 2

Expected outcome is 0 but my solution with 1 also got accepted.Further i just checked cycle for vertex no. 1 and the solution got ac