Leetcode Interview questions 08.03 Title reference code :
class Solution:
def findMagicIndex(self, nums: List[int]) -> int:
for i in range(len(nums)):
if nums[i]==i:
return i
return -1
Topic link :
Power button https://leetcode.cn/problems/magic-index-lcci/