1 public class UfArray implements UF { 2 private int array[]=null; 3 public UfArray(int n) { 4 array=new int[n]; 5 for(int i=0;i<array.length;i++){ 6 ...
分类:
其他好文 时间:
2020-01-06 09:55:07
阅读次数:
80
有四个剑客,他们很厉害 Find 查询命令,就是find 1 2 usage: find [-H | -L | -P] [-EXdsx] [-f path] path ... [expression] find [-H | -L | -P] [-EXdsx] -f path [path ...] [ ...
分类:
系统相关 时间:
2020-01-06 09:37:59
阅读次数:
107
这道题暴力的做法就是O(N^2),但是通过观察,我们可以得到一个数学公式,即 total_sum + nums[i] == 2*current_sum 通过这个关系,我们可以先求出来total_sum, 然后loop trough,每一个position i,看看是不是满足这个公式。满足就可以ret ...
分类:
其他好文 时间:
2020-01-06 09:22:43
阅读次数:
71
K8s在helm初始化的报错,我的k8s为1.16.1,用的helm是2.13.1 [root@k8s-master ~]# helm init --service-account tiller --skip-refresh Creating /root/.helm Creating /root/. ...
分类:
其他好文 时间:
2020-01-06 00:05:47
阅读次数:
382
单个元素 1. 通过id定位:wd.find_element_by_id() 2. 通过name定位:wd.find_element_by_name() 3. 通过class定位:wd.find_element_by_class_name() 4. 通过tag定位:wd.find_element_b ...
分类:
编程语言 时间:
2020-01-05 20:53:44
阅读次数:
84
第一种: 先从数据库中取出数据,然后再更新字段。效率较低,需要2次数据库操作; 生成的sql语句是: 第二种: 根据主键更新某个字段。如下虽然定义的变量里有password,但是没有设置ismodified=true,所以在savechanges时只会更新name的值 生成的sql语句是: 第三种: ...
分类:
其他好文 时间:
2020-01-05 15:59:48
阅读次数:
102
Given a binary tree, find the length of the longest consecutive sequence path. The path refers to any sequence of nodes from some starting node to any ...
分类:
其他好文 时间:
2020-01-05 11:56:36
阅读次数:
74
题意:Given a n × n matrix A and a positive integer k, find the sum S = A + A2 + A3 + … + Ak. n (n ≤ 30), k (k ≤ 109) and m (m < 104) 输出结果矩阵 解法: 若 n是偶数 S ...
分类:
其他好文 时间:
2020-01-05 10:09:31
阅读次数:
80
Given a binary tree, find the leftmost value in the last row of the tree. Example 1: Input: 2 / \ 1 3 Output: 1 Example 2: Input: 1 / \ 2 3 / / \ 4 5 ...
分类:
其他好文 时间:
2020-01-05 09:54:14
阅读次数:
60
原题链接在这里:https://leetcode.com/problems/find-the-closest-palindrome/ 题目: Given an integer n, find the closest integer (not including itself), which is a ...
分类:
其他好文 时间:
2020-01-05 09:47:45
阅读次数:
59