题目描述: 第一次提交:通过76/78 留坑 class Solution: def isBipartite(self, graph: List[List[int]]) -> bool: dic = {} l = [] for i in range(len(graph)): if graph[i] ...
分类:
其他好文 时间:
2020-07-17 14:14:05
阅读次数:
61
Given an array of integers, find two numbers such that they add up to a specific target number. The function twoSum should return indices of the two n ...
分类:
其他好文 时间:
2020-07-17 13:33:50
阅读次数:
46
public <E> List<E> selectList(Mapper mapper, Connection conn){ PreparedStatement pstm = null; ResultSet rs = null; try{ String queryString = mapper.ge ...
分类:
数据库 时间:
2020-07-17 11:34:51
阅读次数:
97
range()函数 range(101):可以用来产生0到100范围的整数,需要注意的是取不到101。 range(1, 101):可以用来产生1到100范围的整数,相当于前面是闭区间后面是开区间。 range(1, 101, 2):可以用来产生1到100的奇数,其中2是步长,即每次数值递增的值。 ...
分类:
编程语言 时间:
2020-07-17 11:22:42
阅读次数:
287
#打印九九乘法表#-*- coding :UTF-8 -*-#打印九九乘法表for i in range(1,10): for j in range(1,i+1): ##打印语句中,大括号及其里面的字符(称作格式化字段)将会被被 .format() 中的参数替换,注意有个点的 print('{}x{ ...
分类:
其他好文 时间:
2020-07-16 21:49:17
阅读次数:
67
一、可迭代对象(iterable) 我们知道,在Python世界里,一切皆对象。对象根据定义的维度,又可以分为各种不同的类型,比如:文件对象,字符串对象,列表对象。。。等等。 那什么对象才能叫做可迭代对象呢?一句话:“实现了__inter__方法的对象就叫做可迭代对象”,__inter__方法的作用 ...
分类:
其他好文 时间:
2020-07-16 21:12:36
阅读次数:
42
一、可迭代对象(iterable) 我们知道,在Python世界里,一切皆对象。对象根据定义的维度,又可以分为各种不同的类型,比如:文件对象,字符串对象,列表对象。。。等等。 那什么对象才能叫做可迭代对象呢?一句话:“实现了__inter__方法的对象就叫做可迭代对象”,__inter__方法的作用 ...
分类:
其他好文 时间:
2020-07-16 21:05:16
阅读次数:
42
print('\n'.join([''.join([('AndyLove'[(x-y)%8]if((x*0.05)**2+(y*0.1)**2-1)**3-(x*0.05)**2*(y*0.1)**3<=0 else' ')for x in range(-30,30)])for y in range ...
分类:
编程语言 时间:
2020-07-16 12:22:02
阅读次数:
61
The Hamming distance between two integers is the number of positions at which the corresponding bits are different. Now your job is to find the total ...
分类:
其他好文 时间:
2020-07-16 12:06:09
阅读次数:
75
problem 1380. Lucky Numbers in a Matrix 在矩阵中,如果一个数既是它所在行的最小值,又是它所在列的最大值,则称这个数为幸运数。找到矩阵中所有的幸运数。 Constraints All elements in the matrix are distinct. so ...
分类:
其他好文 时间:
2020-07-16 00:15:33
阅读次数:
72