Given a collection of number segments, you are supposed to recover the smallest number from them. For example, given { 32, 321, 3214, 0229, 87 }, we c ...
分类:
其他好文 时间:
2018-09-23 13:48:06
阅读次数:
191
Given an unsorted integer array, find the smallest missing positive integer.Example 1:Input: [1,2,0]Output: 3Example 2:Input: [3,4,-1,1]Output: 2Examp ...
分类:
其他好文 时间:
2018-09-16 12:23:58
阅读次数:
137
Given N integers, you are supposed to find the smallest positive integer that is NOT in the given list. Input Specification: Each input file contains ...
分类:
其他好文 时间:
2018-09-15 22:07:00
阅读次数:
220
https://leetcode.com/problems/smallest-range/description/ 给你k个数组,找一个最小区间[a,b],可以包含k个数组中的数字各至少一个。 滑动窗口题。 对于要求“最短”的题目很适用。 points: 1.在扩张右界的时候,一旦碰到合法就停止,但 ...
分类:
其他好文 时间:
2018-09-13 14:25:14
阅读次数:
155
def findsmallest(arr): smallest=arr[0] smallest_index=0 for i in range(1,len(arr)): #smallest_index+=1 if arr[i]<=smallest: smallest=arr[i] smallest_i ...
分类:
编程语言 时间:
2018-09-09 20:32:16
阅读次数:
208
Description Give you a number S of length n,you can choose a position and remove the number on it.After that,you will get a new number. More formally, ...
分类:
其他好文 时间:
2018-09-01 20:23:35
阅读次数:
143
题目链接 https://leetcode.com/problems/kth smallest element in a bst/description/ 题目描述 Given a binary search tree, write a function kthSmallest to find th ...
分类:
其他好文 时间:
2018-08-28 14:26:01
阅读次数:
154
[抄题]: You are given two integer arrays nums1 and nums2 sorted in ascending order and an integer k. Define a pair (u,v) which consists of one element f ...
分类:
其他好文 时间:
2018-08-24 10:48:20
阅读次数:
194
[抄题]: Given a positive 32-bit integer n, you need to find the smallest 32-bit integer which has exactly the same digits existing in the integer n and ...
分类:
其他好文 时间:
2018-08-21 22:40:44
阅读次数:
313