class Solution(object): def kWeakestRows(self, mat, k): """ :type mat: List[List[int]] :type k: int :rtype: List[int] """ power = [sum(line) for line ...
分类:
其他好文 时间:
2020-06-08 14:49:39
阅读次数:
59
class Solution(object): def arrangeCoins(self, n): """ :type n: int :rtype: int """ return int(2 ** 0.5 * (n + 1 / 8) ** 0.5 - 1 / 2) if __name__ == ' ...
分类:
其他好文 时间:
2020-06-08 14:38:44
阅读次数:
59
一,接口设计 使用polygon函数来画一个50边形,来接近一个圆。写circle这个函数了,需要半径r作为一个参数: $ cat circle.py #!/bin/bash import math def circle(t, r): circumference = 2 * math.pi * r ...
分类:
编程语言 时间:
2020-06-08 12:55:46
阅读次数:
86
Redis的每个Key都可以设置一个过期时间,当达到过期时间的时候,这个key就会被自动删除。 ...
分类:
其他好文 时间:
2020-06-08 12:28:50
阅读次数:
58
With Sheets("Report").ChartObjects.Add(...) .Chart.Axes(xlCategory).MinimumScale = RoundTo50(Sheets(sheetName).Range("M4")) .Chart.Axes(xlCategory).Ma ...
分类:
编程语言 时间:
2020-06-07 21:45:16
阅读次数:
115
@ Java 实现 class PrimeNumber{ public static void main(String[] args) { long start=System.currentTimeMillis(); int count=0; label:for(int i=1;i<=100000; ...
分类:
编程语言 时间:
2020-06-07 19:32:18
阅读次数:
59
Java 是一个近乎纯洁的面向对象编程语言,但是为了编程的方便还是引入了基本 数据类型,但是为了能够将这些基本数据类型当成对象操作,Java 为每一个基本 数据类型都引入了对应的包装类型(wrapper class),int 的包装类就是 Integer, 从 Java 5 开始引入了自动装箱/拆箱 ...
分类:
其他好文 时间:
2020-06-07 16:43:40
阅读次数:
84
列表推导式 A = [i for i in range(0,10)] B = [ i**2 for i in A] 字典推导式 for k,v in zip(['a','b','c','d'],[1,2,3,4]): print(k,v) d = { key:value for (key,value ...
分类:
编程语言 时间:
2020-06-07 16:22:12
阅读次数:
60
导入模块 from tqdm import tqdm import time ''' desc 描述 ncols 进度条总长度 可修改 range(1000) 封装迭代器 ''' for i in tqdm(range(1000),ncols=100,desc='商品进度加载'): time.sle ...
分类:
其他好文 时间:
2020-06-07 14:43:25
阅读次数:
49
base = [str(x) for x in range(10)] + [chr(x) for x in range(ord('A'), ord('A') + 6)] # ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C ...
分类:
其他好文 时间:
2020-06-07 13:15:30
阅读次数:
85