系统巡检: Linux CentOS、Ubuntu #查看CPU核数 cat /proc/cpuinfo | grep "cpu cores" | uniq | awk -F ' ' '{print $4}' #查看CPU个数 cat /proc/cpuinfo | grep "physical i ...
分类:
其他好文 时间:
2020-07-13 15:27:15
阅读次数:
82
Given an array of integers nums. A pair (i,j) is called good if nums[i] == nums[j] and i < j. Return the number of good pairs. Example 1: Input: nums ...
分类:
其他好文 时间:
2020-07-13 09:59:42
阅读次数:
75
Given an array of integers nums. A pair (i,j) is called good if nums[i] == nums[j] and i < j. Return the number of good pairs. Example 1: Input: nums ...
分类:
其他好文 时间:
2020-07-13 09:57:03
阅读次数:
63
周赛地址(英):weekly contest 197 周赛地址(中):第 197 场周赛 仓库地址:week-Leetcode 1512. Number of Good Pairs Given an array of integers nums. A pair (i,j) is called goo ...
分类:
其他好文 时间:
2020-07-12 22:23:56
阅读次数:
56
a, b = 10, 2*x <--> a=10; b=2*x多值赋值经常用来交换变量,或将函数调用返回给变量: x, y = y, x -- swap 'x' for 'y' a[i], a[j] = a[j], a[i] -- swap 'a[i]' for 'a[j]' a, b = f() ...
分类:
其他好文 时间:
2020-07-12 17:02:48
阅读次数:
66
重启了centos后,发现k8s没有正常启动 # kubectl get nodes 提示无法正常连接,查看k8s是否正常启动 # systemctl status kubelet 提示:Active: activating (auto-restart) (Result: exit-code) 查看 ...
分类:
其他好文 时间:
2020-07-12 14:43:02
阅读次数:
141
package main import ( "fmt" ) func main() { a := 1 b := 2 defer func() { err := recover() //recover只能放在defer之后使用 fmt.Println(err) }() //匿名函数 swap(a, b ...
分类:
其他好文 时间:
2020-07-12 01:17:27
阅读次数:
88
c++顺序容器常用知识总结: 目录 一.定义和初始化 有关于unsingned int 与 size_t的有关区分 二.常用操作 1.begin和end 2.容器添加元素操作 3.容器大小的操作 4.访问容器元素的操作 5.删除容器元素的操作 6.容器的赋值与swap操作 正文 容器是一种容纳特定类 ...
分类:
编程语言 时间:
2020-07-11 19:05:21
阅读次数:
72
给定一个链表,两两交换其中相邻的节点,并返回交换后的链表。 你不能只是单纯的改变节点内部的值,而是需要实际的进行节点交换。 示例: 给定 1->2->3->4, 你应该返回 2->1->4->3. class Solution: def swapPairs(self, head: ListNode) ...
分类:
其他好文 时间:
2020-07-11 18:58:30
阅读次数:
51
题目描述 给定一个单链表,把所有的奇数节点和偶数节点分别排在一起。请注意,这里的奇数节点和偶数节点指的是节点编号的奇偶性,而不是节点的值的奇偶性。 请尝试使用原地算法完成。你的算法的空间复杂度应为 O(1),时间复杂度应为 O(nodes),nodes 为节点总数。 示例: 输入: 1->2->3- ...
分类:
其他好文 时间:
2020-07-11 15:37:06
阅读次数:
48