Loading

摘要: 题目 代码class MinStack {public: /** initialize your data structure here. */ MinStack():nums(),sorted() { } void p... 阅读全文
posted @ 2019-02-23 22:08 李正浩 阅读(102) 评论(0) 推荐(0) 编辑
摘要: 题目 代码 class Solution {public: int numSquares(int n) { vector dp(n + 1, INT_MAX); dp[0] = 0; for (int i = 0; i <=... 阅读全文
posted @ 2019-02-23 18:50 李正浩 阅读(143) 评论(0) 推荐(0) 编辑
摘要: 题目 代码class MyCircularQueue {public: /** Initialize your data structure here. Set the size of the queue to be k. */ MyCircularQueue(... 阅读全文
posted @ 2019-02-23 15:53 李正浩 阅读(131) 评论(0) 推荐(0) 编辑
摘要: 题目 代码class Solution {public: string reverseWords(string s) { for(int i=0,j=0;j<=s.size();j++) { if(j==s.size()... 阅读全文
posted @ 2019-02-23 12:09 李正浩 阅读(109) 评论(0) 推荐(0) 编辑
摘要: 题目 代码 class Solution {public: void reverseWords(string &s) { if (s.empty()) return; //-----判断是否不包含单词,全是空格 bool isSpace = ... 阅读全文
posted @ 2019-02-23 12:07 李正浩 阅读(112) 评论(0) 推荐(0) 编辑
摘要: 题目 代码 class Solution {public: vector getRow(int rowIndex) { vector array(rowIndex+1); for(int i=0;i 0; j--){ ... 阅读全文
posted @ 2019-02-23 10:24 李正浩 阅读(128) 评论(0) 推荐(0) 编辑
摘要: 题目 代码 class Solution {public: int minSubArrayLen(int s, vector& nums) { if(nums.empty()) return 0; int start=0,e... 阅读全文
posted @ 2019-02-23 09:57 李正浩 阅读(145) 评论(0) 推荐(0) 编辑
摘要: 题目 代码 class Solution {public: int findMaxConsecutiveOnes(vector& nums) { int length=0; int maxLength=0; for(int i=... 阅读全文
posted @ 2019-02-23 09:14 李正浩 阅读(251) 评论(0) 推荐(0) 编辑