上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 21 下一页
摘要: ```python3 class Solution: def twoSum(self, numbers, target): """ :type numbers: List[int] :type target: int :rtype: List[int] """ d = {} fo... 阅读全文
posted @ 2018-08-09 14:59 一条图图犬 阅读(213) 评论(0) 推荐(0) 编辑
摘要: ```C++ class Solution { public: vector findDisappearedNumbers(vector& nums) { vector res; int m; for(int i=0;i 0){ nums[m] *= -1; } } ... 阅读全文
posted @ 2018-08-08 16:52 一条图图犬 阅读(266) 评论(0) 推荐(0) 编辑
摘要: ```python3 class Solution: def containsDuplicate(self, nums): """ :type nums: List[int] :rtype: bool """ s = set() for i in nums: if i i... 阅读全文
posted @ 2018-08-08 16:25 一条图图犬 阅读(184) 评论(0) 推荐(0) 编辑
摘要: class Solution { public: int maxProfit(vector& prices) { if( prices.empty() || prices.size() prices[i] mi ? res:prices[i] mi; mi = mi 阅读全文
posted @ 2018-08-08 16:20 一条图图犬 阅读(171) 评论(0) 推荐(0) 编辑
摘要: ```python3 class Solution: def twoSum(self, nums, target): """ :type nums: List[int] :type target: int :rtype: List[int] """ d = {} for i in... 阅读全文
posted @ 2018-08-04 23:46 一条图图犬 阅读(148) 评论(0) 推荐(0) 编辑
摘要: ```python3 class Solution: def findMaxConsecutiveOnes(self, nums): """ :type nums: List[int] :rtype: int """ res = 0 curr = 0 for i in nums... 阅读全文
posted @ 2018-08-04 23:29 一条图图犬 阅读(249) 评论(0) 推荐(0) 编辑
摘要: ```C++ class Solution { public: vector getRow(int rowIndex) { rowIndex++; if(rowIndex res(rowIndex, 0); res[0] = 1; vector curr = res; for(int i=1;i 阅读全文
posted @ 2018-08-04 23:24 一条图图犬 阅读(288) 评论(0) 推荐(0) 编辑
摘要: ```C++ class Solution { public: void moveZeroes(vector& nums) { if(nums.empty() || nums.size() == 1){ return; } auto slow = nums.begin(); auto fast = 阅读全文
posted @ 2018-08-04 22:55 一条图图犬 阅读(104) 评论(0) 推荐(0) 编辑
摘要: ```C++ class Solution { public: int rec(vector & grid, int i, int j){ if(i =grid.size() || j = grid[0].size()){ return 0; } if(grid[i][j] == 1){ grid[ 阅读全文
posted @ 2018-08-04 22:34 一条图图犬 阅读(708) 评论(0) 推荐(0) 编辑
摘要: ```python3 class Solution: def majorityElement(self, nums): """ :type nums: List[int] :rtype: int """ freq = {} for i in nums: if i not ... 阅读全文
posted @ 2018-08-04 22:13 一条图图犬 阅读(331) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 21 下一页