2015年3月5日

Single Number II

摘要: Single Number II 问题: Given an array of integers, every element appears three times except for one. Find that single one. Note:Your algorithm should ha 阅读全文

posted @ 2015-03-05 16:36 zhouzhou0615 阅读(127) 评论(0) 推荐(0)

Integer to Roman

摘要: Integer to Roman 问题: Given an integer, convert it to a roman numeral. Input is guaranteed to be within the range from 1 to 3999. 思路: 映射方法-->等长数组 我的代码: 阅读全文

posted @ 2015-03-05 15:16 zhouzhou0615 阅读(146) 评论(0) 推荐(0)

Maximum Subarray

摘要: Maximum Subarray 问题: Find the contiguous subarray within an array (containing at least one number) which has the largest sum. For example, given the a 阅读全文

posted @ 2015-03-05 14:53 zhouzhou0615 阅读(118) 评论(0) 推荐(0)

Roman to Integer

摘要: Roman to Integer问题:Given a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999.思路:转换公式而已 前面的比自己大 相加 前面的比... 阅读全文

posted @ 2015-03-05 10:59 zhouzhou0615 阅读(141) 评论(0) 推荐(0)

第一次刷leetcode小结

摘要: LeetCode 上不会的Reverse IntegerGray CodeGenerate ParenthesesPascal's Triangle II 正方向读和反方向读保持不变的区别Trapping Rain Water 抓住数组的特性 可以排序 可以拿出最大值或者最小值来做参考Unique ... 阅读全文

posted @ 2015-03-05 10:42 zhouzhou0615 阅读(251) 评论(0) 推荐(0)

N-Queens II

摘要: N-Queens II 问题: Follow up for N-Queens problem. Now, instead outputting board configurations, return the total number of distinct solutions 思路: 典型的DFS 阅读全文

posted @ 2015-03-05 10:39 zhouzhou0615 阅读(127) 评论(0) 推荐(0)

导航