摘要:
Given an array nums, write a function to move all 0's to the end of it while maintaining the relative order of the non-zero elements. For example, giv
阅读全文
posted @ 2017-07-28 17:21
Beserious
阅读(150)
推荐(0)
编辑
摘要:
Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice in the arr
阅读全文
posted @ 2017-07-28 16:34
Beserious
阅读(193)
推荐(0)
编辑
摘要:
Given an integer array, find three numbers whose product is maximum and output the maximum product. Example 1: Example 2: Note: 排序,然后前后枚举一下就行了 3种情况。 或
阅读全文
posted @ 2017-07-28 16:22
Beserious
阅读(141)
推荐(0)
编辑
摘要:
Given an array containing n distinct numbers taken from 0, 1, 2, ..., n, find the one that is missing from the array. For example,Given nums = [0, 1,
阅读全文
posted @ 2017-07-28 16:03
Beserious
阅读(140)
推荐(0)
编辑
摘要:
Given an array of integers where 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear once. Find all the elements of [1, n]
阅读全文
posted @ 2017-07-28 15:58
Beserious
阅读(145)
推荐(0)
编辑
摘要:
Given a binary array, find the maximum number of consecutive 1s in this array. Example 1: Note: The input array will only contain 0 and 1. The length
阅读全文
posted @ 2017-07-28 12:09
Beserious
阅读(143)
推荐(0)
编辑
摘要:
You are given two arrays (without duplicates) nums1 and nums2 where nums1’s elements are subset of nums2. Find all the next greater numbers for nums1'
阅读全文
posted @ 2017-07-28 11:39
Beserious
阅读(132)
推荐(0)
编辑