#判断返回结果是否包含预期结果 def is_contain(self,str_one,str_two):#判断str_one是否包含于str_two flag=None try: str_one.index(str_two)>1 except: print('PASS!') ... ...
分类:
编程语言 时间:
2019-06-09 00:20:52
阅读次数:
125
1、public static String toString(数组),将参数数组变成字符串(按照默认格式) int [] intArray = {10,20,30}; String str = Arrays.toString(intArray); 2、pubblic static void sor ...
分类:
编程语言 时间:
2019-06-07 22:56:46
阅读次数:
105
Write a program to find the node at which the intersection of two singly linked lists begins. For example, the following two linked lists: begin to in ...
分类:
其他好文 时间:
2019-06-07 21:00:31
阅读次数:
114
Given two binary trees, write a function to check if they are the same or not. Two binary trees are considered the same if they are structurally ident ...
分类:
其他好文 时间:
2019-06-06 21:14:27
阅读次数:
89
mycode 77.78% 参考: 1、应用collection.Counter库,可以实现与运算 2、 ...
分类:
其他好文 时间:
2019-06-06 15:31:21
阅读次数:
79
mycode 91.28% 参考: 思路:其实时不能用除法运算的,但是我还是用了。。。。 这道题的要求是在不使用乘法、除法、取模运算的前提下实现两个整数相除。如果溢出,返回MAX_INT。这道题的直接思路是用被除数不断减去除数,直到为0。这种方法的迭代次数是结果的大小,即比如结果为n,算法复杂度是O ...
分类:
其他好文 时间:
2019-06-06 09:24:27
阅读次数:
90
Given two binary strings, return their sum (also a binary string). The input strings are both non-empty and contains only characters 1 or 0. Example 1 ...
分类:
其他好文 时间:
2019-06-06 00:35:13
阅读次数:
101
def function_with_one_star(*t): print(t, type(t)) def function_with_two_stars(**d) print(d, type(d))上面定义了两个函数,分别用了带一个星号和两个星号的参数,它们是什么意思,运行下面的代码: funct ...
分类:
编程语言 时间:
2019-06-06 00:29:03
阅读次数:
134
描述 There are N beads which of the same shape and size, but with different weights. N is an odd number and the beads are labeled as 1, 2, ..., N. Your ...
分类:
其他好文 时间:
2019-06-05 23:56:08
阅读次数:
216
class Solution {public: vector<int> twoSum(vector<int>& nums, int target) { int n=nums.size(); int i,j; vector<int> res(2); for (i=0;i<n-1;i++){ for ( ...
分类:
其他好文 时间:
2019-06-05 23:32:22
阅读次数:
117