摘要: 思路分析 : 最后的答案一定是介于 1~n+1 之间,那么就可以将不在这个范围的数都变为 n+1,对于每个位置的数,不断的交换到它应该所在的位置 参考代码: class Solution { public: int firstMissingPositive(vector<int>& nums) { 阅读全文
posted @ 2021-11-07 22:09 楼主好菜啊 阅读(28) 评论(0) 推荐(0) 编辑