上一页 1 2 3 4 5 6 7 ··· 15 下一页
摘要: #coding=utf-8# floodfill经典题# step 1) 从太平洋的边界出发,找到所有能到达太平样的点 TP# step 2) 从大西洋的边界出发,找到所有能到达大西洋的点 DX# step 3) 求交集 TP DXclass Solution(object): def pacifi 阅读全文
posted @ 2019-03-19 10:43 AceKo 阅读(277) 评论(0) 推荐(0)
摘要: class Solution(object): def readBinaryWatch(self, num): """ :type num: int :rtype: List[str] """ hour = [1,2,4,8] minute = [1,2,4,8,16,32] self.resHou 阅读全文
posted @ 2019-03-19 10:41 AceKo 阅读(240) 评论(0) 推荐(0)
摘要: class Solution(object): def combinationSum3(self, k, n): """ :type k: int :type n: int :rtype: List[List[int]] """ self.res = [] self.generateCombinat 阅读全文
posted @ 2019-03-19 10:40 AceKo 阅读(176) 评论(0) 推荐(0)
摘要: class Solution(object): def numIslands(self, grid): """ :type grid: List[List[str]] :rtype: int """ self.res = 0 if not grid : return self.res self.dr 阅读全文
posted @ 2019-03-19 10:39 AceKo 阅读(140) 评论(0) 推荐(0)
摘要: class Solution(object): def partition(self, s): """ :type s: str :rtype: List[List[str]] """ self.res =[] ans = [] self.findDivide(s,ans) print self.r 阅读全文
posted @ 2019-03-19 10:38 AceKo 阅读(345) 评论(0) 推荐(0)
摘要: #coding=utf-8class Solution(object): def solve(self, board): """ :type board: List[List[str]] :rtype: void Do not return anything, modify board in-pla 阅读全文
posted @ 2019-03-19 10:37 AceKo 阅读(210) 评论(0) 推荐(0)
摘要: class Solution(object): def restoreIpAddresses(self, s): """ :type s: str :rtype: List[str] """ self.res = [] self.findCombination(s,"",0) return self 阅读全文
posted @ 2019-03-19 10:35 AceKo 阅读(348) 评论(0) 推荐(0)
摘要: class Solution(object): def subsetsWithDup(self, nums): """ :type nums: List[int] :rtype: List[List[int]] """ self.res = [] self.old = None self.res.a 阅读全文
posted @ 2019-03-19 10:34 AceKo 阅读(236) 评论(0) 推荐(0)
摘要: class Solution(object): def exist(self, board, word): """ :type board: List[List[str]] :type word: str :rtype: bool """ self.d = [[-1,0],[0,1],[1,0],[ 阅读全文
posted @ 2019-03-19 10:33 AceKo 阅读(194) 评论(0) 推荐(0)
摘要: class Solution(object): def subsets(self, nums): """ :type nums: List[int] :rtype: List[List[int]] """ self.res = [] self.res.append([]) # for i in ra 阅读全文
posted @ 2019-03-19 10:32 AceKo 阅读(179) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 ··· 15 下一页