Solution1 遍历一次,记录索引

时间复杂度 O(n) 空间复杂度 O(1)

Last updated