摘要: 题目描述:Givennnon-negative integersa1,a2, ...,an, where each represents a point at coordinate (i,ai).nvertical lines are drawn such that the two endpoint... 阅读全文
posted @ 2014-09-29 23:01 skycore 阅读(167) 评论(0) 推荐(0) 编辑
摘要: 题目描述:Reverse digits of an integer.Example1:x = 123, return 321Example2:x = -123, return -321解题方案:该题比较简单,直接贴代码: 1 class Solution { 2 public: 3 int ... 阅读全文
posted @ 2014-09-29 22:56 skycore 阅读(154) 评论(0) 推荐(0) 编辑
摘要: 题目描述:Given an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the t... 阅读全文
posted @ 2014-09-29 22:53 skycore 阅读(195) 评论(0) 推荐(0) 编辑
摘要: 题目描述:Given an array of integers, every element appearstwiceexcept for one. Find that single one.Note:Your algorithm should have a linear runtime compl... 阅读全文
posted @ 2014-09-29 22:46 skycore 阅读(114) 评论(0) 推荐(0) 编辑