leetcode1064

1 class Solution:
2     def fixedPoint(self, A: 'List[int]') -> int:
3         for i in range(len(A)):
4             if i == A[i]:
5                 return i
6         return -1

猜你喜欢

转载自www.cnblogs.com/asenyang/p/10961835.html