Leetcode算法——4一、尋找缺失的正數

給定一個亂序的整數數組,找到最小的缺失的正整數。python 示例:web Example 1: Input: [1,2,0] Output: 3 Example 2: Input: [3,4,-1,1] Output: 2 Example 3: Input: [7,8,9,11,12] Output: 1 思路 一、標記法 若是 nums 的長度爲 l,則結果確定是在 1 ~ (l+1) 中
相關文章
相關標籤/搜索