摘要: code第一部分数组:第二十三题 奇数次中查找单独出现一次的数 Given an array of integers, every element appears three times except for one. Find that single one. Note: Your algorit 阅读全文
posted @ 2017-02-25 22:19 taoliu_alex 阅读(248) 评论(0) 推荐(0) 编辑
摘要: code第一部分数组:第二十二题 偶数次中查找单独出现一次的数 Given an array of integers, every element appears twice except for one. Find that single one.Note: Your algorithm shou 阅读全文
posted @ 2017-02-25 22:18 taoliu_alex 阅读(126) 评论(0) 推荐(0) 编辑
摘要: code第一部分数组:第二十一题:分糖果 给糖果,每人至少一颗,高分孩子得到比左右多,求糖果数。there are N children standing in a line. Each child is assigned a rating value.You are giving candies 阅读全文
posted @ 2017-02-25 22:17 taoliu_alex 阅读(280) 评论(0) 推荐(0) 编辑
摘要: code第一部分数组:第二十题:加油站 there are N gas stations along a circular route, where the amount of gas at station i is gas[i].You have a car with an unlimited g 阅读全文
posted @ 2017-02-25 22:16 taoliu_alex 阅读(153) 评论(0) 推荐(0) 编辑
摘要: code第一部分数组:第十九题 矩阵元素为0,横列置零 分析 O(m + n) 空间的方法很简单,设置两个数组,记录每行和每列是否存在 0。 阅读全文
posted @ 2017-02-25 22:15 taoliu_alex 阅读(257) 评论(0) 推荐(0) 编辑
摘要: code第一部分数组:第十七题 爬楼梯问题 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 dis 阅读全文
posted @ 2017-02-25 22:14 taoliu_alex 阅读(253) 评论(0) 推荐(0) 编辑
摘要: code第一部分数组:第十六题 数组表示数,加一操作 Given a number represented as an array of digits, plus one to the number. 阅读全文
posted @ 2017-02-25 22:13 taoliu_alex 阅读(230) 评论(0) 推荐(0) 编辑
摘要: code第一部分数组:第十五题 矩阵翻转(图像翻转) 首先想到,纯模拟,从外到内一圈一圈的转,但这个方法太慢。如下图,首先沿着副对角线翻转一次,然后沿着水平中线翻转一次。 源代码 阅读全文
posted @ 2017-02-25 22:12 taoliu_alex 阅读(291) 评论(0) 推荐(0) 编辑
摘要: code第一部分:数组 第十四题 雨水问题 Given n non-negative integers representing an elevation map where the width of each bar is 1, computehow much water it is able t 阅读全文
posted @ 2017-02-25 22:10 taoliu_alex 阅读(285) 评论(0) 推荐(0) 编辑
摘要: code第一部分数组:第十题:移除数组中目标元素 Given an array and a value, remove all instances of that value in place and return the new length.the order of elements can b 阅读全文
posted @ 2017-02-25 22:09 taoliu_alex 阅读(181) 评论(0) 推荐(0) 编辑