12 2015 档案
摘要:@link http://www.cnblogs.com/zuoyuan/p/3781953.htmlGiven an array of non-negative integers, you are initially positioned at the first index of the arr...
        阅读全文
                
摘要:谈谈Memcached与Redis(一) 1. Memcached简介Memcached是以LiveJurnal旗下Danga Interactive公司的Bard Fitzpatric为首开发的高性能分布式内存缓存服务器。其本质上就是一个内存key-value数据库,但是不支持数据的持久化,服务...
        阅读全文
                
摘要:class Solution(object): def trap(self,nums): leftmosthigh = [0 for i in range(len(nums))] leftmax=0 for i in range(len(nums))...
        阅读全文
                
摘要:class Solution(object): def firstMissingPositive(self, nums): """ :type nums: List[int] :rtype: int """ intlen=l...
        阅读全文
                
摘要: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...
        阅读全文
                
摘要: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...
        阅读全文
                
摘要:class Solution(object): def countAndSay(self, n): """ :type n: int :rtype: str """ s='1' for i in range(2...
        阅读全文
                
摘要:#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...
        阅读全文
                
摘要:#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...
        阅读全文
                
摘要:#数独(すうどく,Sūdoku)是一种运用纸、笔进行演算的逻辑游戏。玩家需要根据9×9盘面上的已知数字,推理出所有剩余空格的数字,并满足每一行、每一列、每一个粗线宫内的数字均含1-9,不重复。#数独盘面是个九宫,每一宫又分为九个小格。在这八十一格中给出一定的已知数字和解题条件,利用逻辑和推理,在其他...
        阅读全文
                
摘要:#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 ...
        阅读全文
                
摘要:#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...
        阅读全文
                
摘要:#question : Given an array of integers, every element appearstwiceexcept for one. Find that single one.#note : Your algorithm should have a linear run...
        阅读全文
                
摘要:# The isBadVersion API is already defined for you.# @param version, an integer# @return a bool# def isBadVersion(version):class Solution(object): d...
        阅读全文
                
摘要:class Solution(object): def searchRange(self, nums, target): """ :type nums: List[int] :type target: int :rtype: List[i...
        阅读全文
                
摘要:class Solution(object): def longestValidParentheses(self, s): """ :type s: str :rtype: int """ maxlen=0 s...
        阅读全文
                
摘要:rs=dict()rs['item1'] = 'item1'rs['item2'] = 'item2'for k,d in rs.items(): print k,dfor k in rs.keys(): print k,rs[k]
        阅读全文
                
摘要:#"~" must be used for case sensitive matching #"~*" must be used for case insensitive matching location = / { # this matches only the / query. # configuration example #1 } location / { ...
        阅读全文
                
摘要:需求:前端过来一个请求,后台php要通过两次http请求,请求不同的地址得到资源后拼接返回给前端请求A站:请求B站:同时请求A站和B站(php 串行curl_exec )同时请求A站和B站(php 模拟并发curl_multi_exec ):同时请求A站和B站(php通过curl_multi_exe...
        阅读全文
                
摘要:# Definition for a binary tree node.# class TreeNode(object):# def __init__(self, x):# self.val = x# self.left = None# sel...
        阅读全文
                
摘要:# Definition for singly-linked list.# class ListNode(object):# def __init__(self, x):# self.val = x# self.next = Noneclass Solutio...
        阅读全文
                
摘要:# Definition for singly-linked list.# class ListNode(object):# def __init__(self, x):# self.val = x# self.next = Noneclass Solutio...
        阅读全文
                
摘要:class Node(object): def __init__(self,k,x): self.key=k self.val=x self.prev=None self.next=Noneclass DoubleLinkedList(o...
        阅读全文
                
摘要:with open opcache, the monitor cpu idle log , there are so much curl_exec and gzip in our php logic code, and our php version is 5.4.44
        阅读全文
                
摘要:# Definition for a binary tree node.# class TreeNode(object):# def __init__(self, x):# self.val = x# self.left = None# sel...
        阅读全文
                
摘要:# Definition for a binary tree node.# class TreeNode(object):# def __init__(self, x):# self.val = x# self.left = None# sel...
        阅读全文
                
摘要:# Definition for a binary tree node.# class TreeNode(object):# def __init__(self, x):# self.val = x# self.left = None# sel...
        阅读全文
                
摘要:# Definition for a binary tree node# class TreeNode(object):# def __init__(self, x):# self.val = x# self.left = None# sel...
        阅读全文
                
摘要:# Definition for a binary tree node.# class TreeNode(object):# def __init__(self, x):# self.val = x# self.left = None# sel...
        阅读全文
                
摘要:# Definition for a binary tree node.# class TreeNode(object):# def __init__(self, x):# self.val = x# self.left = None# sel...
        阅读全文
                
摘要:# Definition for a binary tree node.# class TreeNode(object):# def __init__(self, x):# self.val = x# self.left = None# sel...
        阅读全文
                
摘要:# Definition for a binary tree node.# class TreeNode(object):# def __init__(self, x):# self.val = x# self.left = None# sel...
        阅读全文
                
摘要:# Definition for a binary tree node.# class TreeNode(object):# def __init__(self, x):# self.val = x# self.left = None# sel...
        阅读全文
                
摘要:1. binary tree inorder traversal 不能用recursive写 (LC原题)2. 比如有个数组F={1,3, 4, 5, 2, 0}, A=3, 那么F[A]=5, F[F[A]]=0, F[F[F[A]]]=1....这样下去求第N个数是多少. from: 1poin...
        阅读全文
                
摘要:class Solution(object): def divide(self, dividend, divisor): """ :type dividend: int :type divisor: int :rtype: int ...
        阅读全文
                
 
                    
                
 浙公网安备 33010602011771号
浙公网安备 33010602011771号