Using Python to find the length of a cycle in array of tuples

前端 未结 0 1408
暗喜
暗喜 2020-12-08 05:31

I have an array of tuples; say,

[(1,2), (2,1), (3,4), (4,5), (5,3)]

There are two cycles in the above; one of length 2 and one of length 3. I

相关标签:
回答
  • 消灭零回复
提交回复
热议问题