C++
BYR_LJK
菜鸟
展开
-
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 twoSum should return indices of the t原创 2016-11-07 23:17:21 · 171 阅读 · 0 评论 -
448. Find All Numbers Disappeared in an Array
题目: 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] inclusive that do not appear in this a原创 2016-11-07 23:26:39 · 129 阅读 · 0 评论 -
64. Minimum Path Sum
题目: Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path. Note: You can only move either down or原创 2016-11-08 23:22:15 · 163 阅读 · 0 评论 -
169. Majority Element
题目: Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times. You may assume that the array is non-empty and the majority原创 2016-11-08 23:29:27 · 153 阅读 · 0 评论