Given an unsorted integer array, find the smallest missing positive integer.

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

Note:

Your algorithm should run in O(n) time and uses constant extra space.

题意:

给定无序数组,找出第一个未出现的正整数。

Solution1:

code

[leetcode]41. First Missing Positive第一个未出现的正数的更多相关文章

  1. [LeetCode] 41. First Missing Positive ☆☆☆☆☆(第一个丢失的正数)

    Given an unsorted integer array, find the smallest missing positive integer. Example 1: Input: [1,2, ...

  2. leetCode 41.First Missing Positive (第一个丢失的正数) 解题思路和方法

    First Missing Positive  Given an unsorted integer array, find the first missing positive integer. Fo ...

  3. [array] leetcode - 41. First Missing Positive - Hard

    leetcode - 41. First Missing Positive - Hard descrition Given an unsorted integer array, find the fi ...

  4. LeetCode - 41. First Missing Positive

    41. First Missing Positive Problem's Link ---------------------------------------------------------- ...

  5. [LeetCode] 41. First Missing Positive 首个缺失的正数

    Given an unsorted integer array, find the smallest missing positive integer. Example 1: Input: [1,2, ...

  6. leetcode 41 First Missing Positive ---java

    Given an unsorted integer array, find the first missing positive integer. For example,Given [1,2,0]  ...

  7. Java [Leetcode 41]First Missing Positive

    题目描述: Given an unsorted integer array, find the first missing positive integer. For example,Given [1 ...

  8. LeetCode 41 First Missing Positive(找到数组中第一个丢失的正数)

    题目链接: https://leetcode.com/problems/first-missing-positive/?tab=Description   给出一个未排序的数组,求出第一个丢失的正数. ...

  9. [Leetcode][Python]41: First Missing Positive

    # -*- coding: utf8 -*-'''__author__ = 'dabay.wang@gmail.com' 41: First Missing Positivehttps://oj.le ...

随机推荐

  1. Python生成器(generator)和迭代器(Iterator)

    列表生成式 a = [i+1 for i in range(10)] print(a) [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] 这就是列表生成式 生成器(generator) ...

  2. docker之 网络模式和跨主机通信

    Docker的四种网络模式Bridge模式 当Docker进程启动时,会在主机上创建一个名为docker0... Docker的四种网络模式 Bridge模式 当Docker进程启动时,会在主机上创建 ...

  3. 论文阅读笔记:【MDNet】

    [MDNET]: H Nam, B Han. Learning multi-domain convolutional neural networks for visual tracking[C]. / ...

  4. C# Interview Question 1

    What is C#? What's the feature of C# language? Answer:  

  5. Flask--(一对多)模型渲染表单数据

    模型建立一一对多模型: 多表添加外键,建立两张表之间的关系 一表关联多表的属性,可以方便快速访问多表的数据 模板一层循环渲染一表数据,二层循环渲染多表的数据 代码展示: from flask impo ...

  6. 关于centerOS下修改网络连接

    onboot = yes cd /ect/systemconfig/script-/cfg-ens下

  7. springboot对oracle的配置

    spring.jpa.database=oracle spring.datasource.driver-class-name=oracle.jdbc.driver.OracleDriver sprin ...

  8. 算法实践--最长公共子序列(Longest Common Subsquence)

    什么是最长公共子序列 X=ACCG Y=CCAGCA 长度为1的公共子序列: {A} {C} {G} 长度为2的公共子序列:{AC} {CC} {CG} {AG} 长度为3的公共子序列:{ACG} 长 ...

  9. android ButterKnife 点击事件没反应的解决方案

    可能只添加了 implementation 'com.jakewharton:butterknife:8.8.1'而没有添加下面这行 annotationProcessor 'com.jakewhar ...

  10. ef join查询

    temp = temp.OrderByDescending(s => s.CreateTime).Skip((param.PageIndex - ) * param.PageSize).Take ...