Given a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing all ones and return its area.思路:参见《浅谈用极大化思想解决最大子矩形问题》。这道题我不会,还...
分类:
其他好文 时间:
2014-08-21 22:45:04
阅读次数:
178
Python为我们提供了很多便捷的方式去遍历一个字符串中的字符。比如,将一个字符串转换为一个字符数组(列表):theList=list(theString)同时,我们可以方便的通过for语句进行遍历:for c in theString: do_something_with(c)map函数用法:第一...
分类:
编程语言 时间:
2014-08-21 22:26:34
阅读次数:
263
1.安装虚拟环境$ sudo easy_install virtualenv2.创建虚拟环境$ virtualenv 【env_name】 例如:$ virtualenv virtualtest其中可--no-site-packages可用于指示虚拟环境不要访问 global site-pack.....
分类:
编程语言 时间:
2014-08-21 22:25:04
阅读次数:
413
range的用法:>>> range(1,5) #代表从1到5(不包含5)[1, 2, 3, 4]>>> range(1,5,2) #代表从1到5,间隔2(不包含5)[1, 3]>>> range(5) #代表从0到5(不包含5)[0, 1, 2, 3, 4]列表操作:array = [1, 2, ...
分类:
编程语言 时间:
2014-08-21 21:06:44
阅读次数:
252
#-*-coding:utf-8-*-#python:2.x__author__='Administrator'#当使用多重继承层次结构时,再使用super的时候是非常危险的,主要是因为类的初始化,基类不在__init__中被隐式调用#1滥用super和传统调用#来自jamesknight(http...
分类:
编程语言 时间:
2014-08-21 21:01:54
阅读次数:
257
Given a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x.You should preserve the o...
分类:
其他好文 时间:
2014-08-21 20:58:34
阅读次数:
244
apt-getbuild-deppython-lxmlpipinstalllxml
分类:
编程语言 时间:
2014-08-21 19:43:45
阅读次数:
224
抽了点时间体验了一把python分布式进程,有点像分布式计算的意思,不过我现在还没有这个需求,先把简单体验的脚本发出来,供路过的各位高手指教注:需要先下载multiprocessing的python包支持才行。管理端:cattask_manager.py#!/usr/bin/envpython#coding:utf8importrandom,tim..
分类:
编程语言 时间:
2014-08-21 19:38:05
阅读次数:
246
capitalize()把字符串的第一个字符改为大写casefold()把整个字符串的所有字符改为小写center(width)将字符串居中,并使用空格填充值长度width的新字符串count(sub[,start[,end]])返回sub在字符串里出现的次数,start和end参数表示范围,可选encode(encoding=‘utf-8‘,er..
分类:
编程语言 时间:
2014-08-21 19:36:45
阅读次数:
253
原题:
Given a digit string, return all possible letter combinations that the number could represent.
A mapping of digit to letters (just like on the telephone buttons) is given below.
Input...
分类:
其他好文 时间:
2014-08-21 19:30:24
阅读次数:
225