上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 23 下一页
摘要: class Solution(object): def trap(self,nums): leftmosthigh = [0 for i in range(len(nums))] leftmax=0 for i in range(len(nums))... 阅读全文
posted @ 2015-12-24 23:18 hao.ma 阅读(140) 评论(0) 推荐(0)
摘要: class Solution(object): def firstMissingPositive(self, nums): """ :type nums: List[int] :rtype: int """ intlen=l... 阅读全文
posted @ 2015-12-21 22:58 hao.ma 阅读(146) 评论(0) 推荐(0)
摘要: Given a collection of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T.Each numb... 阅读全文
posted @ 2015-12-20 21:58 hao.ma 阅读(149) 评论(0) 推荐(0)
摘要: Given a set of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T.The same repeate... 阅读全文
posted @ 2015-12-20 21:45 hao.ma 阅读(145) 评论(0) 推荐(0)
摘要: class Solution(object): def countAndSay(self, n): """ :type n: int :rtype: str """ s='1' for i in range(2... 阅读全文
posted @ 2015-12-20 13:50 hao.ma 阅读(133) 评论(0) 推荐(0)
摘要: #if you want to initialize a 9*9 two-dimensional array [([""]*9) for i in range(9)]#caution: the follow code can't work [[""]*9]*9shallow copies of l... 阅读全文
posted @ 2015-12-20 11:37 hao.ma 阅读(331) 评论(0) 推荐(0)
摘要: #the define of Sudoku is on this link : http://sudoku.com.au/TheRules.aspxWrite a program to solve a Sudoku puzzle by filling the empty cells.Empty ce... 阅读全文
posted @ 2015-12-19 23:37 hao.ma 阅读(228) 评论(0) 推荐(0)
摘要: #数独(すうどく,Sūdoku)是一种运用纸、笔进行演算的逻辑游戏。玩家需要根据9×9盘面上的已知数字,推理出所有剩余空格的数字,并满足每一行、每一列、每一个粗线宫内的数字均含1-9,不重复。#数独盘面是个九宫,每一宫又分为九个小格。在这八十一格中给出一定的已知数字和解题条件,利用逻辑和推理,在其他... 阅读全文
posted @ 2015-12-19 17:57 hao.ma 阅读(437) 评论(0) 推荐(0)
摘要: #Given a sorted array and a target value, return the index if the target is found. If #not, return the index where it would be if it were inserted in ... 阅读全文
posted @ 2015-12-19 17:15 hao.ma 阅读(180) 评论(0) 推荐(0)
摘要: #Suppose a sorted array is rotated at some pivot unknown to you beforehand.#(i.e.,0 1 2 4 5 6 7might become4 5 6 7 0 1 2).#You are given a target valu... 阅读全文
posted @ 2015-12-19 16:06 hao.ma 阅读(155) 评论(0) 推荐(0)
上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 23 下一页