上一页 1 ··· 17 18 19 20 21 22 23 24 25 ··· 29 下一页

287. Find the Duplicate Number

摘要: Given an array nums containing n + 1 integers where each integer is between 1 and n (inclusive), prove that at least one duplicate number must exist. 阅读全文
posted @ 2017-03-05 08:51 123_123 阅读(78) 评论(0) 推荐(0) 编辑

167. Two Sum II - Input array is sorted

摘要: Given an array of integers that is already sorted in ascending order, find two numbers such that they add up to a specific target number. The function 阅读全文
posted @ 2017-03-05 08:42 123_123 阅读(121) 评论(0) 推荐(0) 编辑

344. Reverse String

摘要: Write a function that takes a string as input and returns the string reversed. Example: Given s = "hello", return "olleh". 阅读全文
posted @ 2017-03-05 08:17 123_123 阅读(53) 评论(0) 推荐(0) 编辑

485. Max Consecutive Ones

摘要: Given a binary array, find the maximum number of consecutive 1s in this array. Example 1: Input: [1,1,0,1,1,1] Output: 3 Explanation: The first two di 阅读全文
posted @ 2017-03-05 07:56 123_123 阅读(75) 评论(0) 推荐(0) 编辑

202. Happy Number

摘要: Write an algorithm to determine if a number is "happy". A happy number is a number defined by the following process: Starting with any positive intege 阅读全文
posted @ 2017-03-05 07:29 123_123 阅读(87) 评论(0) 推荐(0) 编辑

447. Number of Boomerangs

摘要: Given n points in the plane that are all pairwise distinct, a "boomerang" is a tuple of points (i, j, k) such that the distance between i and j equals 阅读全文
posted @ 2017-03-05 07:09 123_123 阅读(81) 评论(0) 推荐(0) 编辑

350. Intersection of Two Arrays II

摘要: Given two arrays, write a function to compute their intersection. Example: Given nums1 = [1, 2, 2, 1], nums2 = [2, 2], return [2, 2]. 阅读全文
posted @ 2017-03-05 06:13 123_123 阅读(68) 评论(0) 推荐(0) 编辑

217. Contains Duplicate

摘要: 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-03-05 05:22 123_123 阅读(99) 评论(0) 推荐(0) 编辑

94. Binary Tree Inorder Traversal

摘要: //二叉树非递归中序遍历 阅读全文
posted @ 2017-03-05 05:18 123_123 阅读(81) 评论(0) 推荐(0) 编辑

242. Valid Anagram

摘要: Given two strings s and t, write a function to determine if t is an anagram of s. For example, s = "anagram", t = "nagaram", return true. s = "rat", t 阅读全文
posted @ 2017-03-05 04:28 123_123 阅读(97) 评论(0) 推荐(0) 编辑
上一页 1 ··· 17 18 19 20 21 22 23 24 25 ··· 29 下一页