上一页 1 ··· 15 16 17 18 19 20 21 22 23 ··· 29 下一页

palindrome-number

摘要: //判断数组是否是回文 不能用字符串作为辅助,也不能翻转数字(有溢出情况); 阅读全文
posted @ 2017-03-07 02:00 123_123 阅读(186) 评论(0) 推荐(0) 编辑

best-time-to-buy-and-sell-stock-ii

摘要: //给定数组,统计各个数字的最大和。 阅读全文
posted @ 2017-03-07 01:40 123_123 阅读(93) 评论(0) 推荐(0) 编辑

reverse-integer

摘要: Reverse digits of an integer. Example1: x = 123, return 321 Example2: x = -123, return -321 //翻转数字 注意点:1.如果数字的最后后几位是0 eg10,100; 2.数字如果溢出如何处理? 阅读全文
posted @ 2017-03-07 00:10 123_123 阅读(89) 评论(0) 推荐(0) 编辑

linked-list-cycle

摘要: Given a linked list, determine if it has a cycle in it. Follow up: Can you solve it without using extra space? 阅读全文
posted @ 2017-03-07 00:01 123_123 阅读(70) 评论(0) 推荐(0) 编辑

climbing-stairs

摘要: You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb 1 or 2 steps. In how many distinct ways can you cl 阅读全文
posted @ 2017-03-06 23:58 123_123 阅读(148) 评论(0) 推荐(0) 编辑

populating-next-right-pointers-in-each-node

摘要: Given a binary tree Populate each next pointer to point to its next right node. If there is no next right node, the next pointer should be set toNULL. 阅读全文
posted @ 2017-03-06 23:38 123_123 阅读(159) 评论(0) 推荐(0) 编辑

container-with-most-water

摘要: Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpo 阅读全文
posted @ 2017-03-06 22:33 123_123 阅读(135) 评论(0) 推荐(0) 编辑

maximum-depth-of-binary-tree

摘要: Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the root node down to the farthest l 阅读全文
posted @ 2017-03-06 20:32 123_123 阅读(89) 评论(0) 推荐(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. //出现次数超过数组长度一半的元素,排序取出中 阅读全文
posted @ 2017-03-06 11:48 123_123 阅读(76) 评论(0) 推荐(0) 编辑

162. Find Peak Element

摘要: A peak element is an element that is greater than its neighbors. Given an input array where num[i] ≠ num[i+1], find a peak element and return its inde 阅读全文
posted @ 2017-03-06 11:02 123_123 阅读(83) 评论(0) 推荐(0) 编辑
上一页 1 ··· 15 16 17 18 19 20 21 22 23 ··· 29 下一页