Loading

上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 24 下一页
摘要: 题目 代码class Solution {public: int missingNumber(vector& nums) { int result = nums.size(); for(int i=0;i<nums.size... 阅读全文
posted @ 2018-09-17 18:51 李正浩 阅读(90) 评论(0) 推荐(0) 编辑
摘要: 题目 代码class Solution {public: bool isValid(string s) { stack sta; for(auto i:s) { switch(i) { ... 阅读全文
posted @ 2018-09-17 18:47 李正浩 阅读(69) 评论(0) 推荐(0) 编辑
摘要: 题目 代码class Solution {public: vector> generate(int numRows) { vector> res; if(numRows==0) return res; fo... 阅读全文
posted @ 2018-09-17 18:46 李正浩 阅读(96) 评论(0) 推荐(0) 编辑
摘要: 题目 代码class Solution {public: uint32_t reverseBits(uint32_t n) { n=(n>>16)|(n>8)|((n&0x00ff00ff)>4)|((n&0x0f0f0f0f)>2)|((n&0x3333... 阅读全文
posted @ 2018-09-17 18:43 李正浩 阅读(103) 评论(0) 推荐(0) 编辑
摘要: 题目 代码class Solution {public: int hammingDistance(int x, int y) { int res=x^y; int num=1; int result=0; whil... 阅读全文
posted @ 2018-09-17 18:40 李正浩 阅读(124) 评论(0) 推荐(0) 编辑
摘要: 题目 代码class Solution {public: bool isPowerOfThree(int n) { //3的19次方是3的倍数的最大值 //用换底公式 return n > 0 && (log(INT_MAX)/... 阅读全文
posted @ 2018-09-16 08:22 李正浩 阅读(99) 评论(0) 推荐(0) 编辑
摘要: 题目 代码class Solution {public: int countPrimes(int n) { if(n<=2) return 0; int res=1; bool *prime = new b... 阅读全文
posted @ 2018-09-16 08:21 李正浩 阅读(121) 评论(0) 推荐(0) 编辑
摘要: 题目 代码class Solution {public: vector fizzBuzz(int n) { vector res; for(int i=1;i>str; res.push_back(str); ... 阅读全文
posted @ 2018-09-16 08:19 李正浩 阅读(74) 评论(0) 推荐(0) 编辑
摘要: 题目 代码class Solution {public: int maxSubArray(vector& nums) { vector max(nums.size(),0); if(nums.size()==0) ret... 阅读全文
posted @ 2018-09-16 08:18 李正浩 阅读(72) 评论(0) 推荐(0) 编辑
摘要: 题目 代码class Solution {public: int rob(vector& nums) { if(nums.size()==0) return 0; if(nums.size()==1) ... 阅读全文
posted @ 2018-09-16 08:18 李正浩 阅读(75) 评论(0) 推荐(0) 编辑
上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 24 下一页