Remove Duplicates from Sorted List 2 删除排序链表中的重复元素 Given the head of a sorted linked list, delete all nodes that have duplicate numbers, leaving only d ...
分类:
编程语言 时间:
2021-03-17 15:07:16
阅读次数:
0
红黑树 相关概念 1 rb_tree 是一种高度平衡的搜索二叉树,其元素排列的规则有利于 search 和 insert,并同时保持适度的平衡。 2 rb_tree 提供遍历操作以及 iterator。元素放入后有一定的排列规则,按正常规则(++ iter)迭代器遍历时为输出为排序状态(sorted ...
分类:
其他好文 时间:
2021-03-16 13:19:30
阅读次数:
0
88. 合并两个有序数组 LeetCode_88 题目描述 方法一:暴力法 class Solution { public void merge(int[] nums1, int m, int[] nums2, int n) { for(int i=0, j=0; j<n;){ if(i >= m ...
分类:
编程语言 时间:
2021-03-16 11:51:29
阅读次数:
0
The land is for sale in CyberCity, and is divided into several pieces. Here it is assumed that each piece of land has exactly two neighboring pieces, ...
分类:
其他好文 时间:
2021-03-11 19:32:24
阅读次数:
0
Reverse Linked List II 反转链表 Given the head of a singly linked list and two integers left and right where left <= right, reverse the nodes of the list ...
分类:
编程语言 时间:
2021-03-10 13:27:14
阅读次数:
0
练习: 输出一个a-z的随机集合,然后去重,按照a-z的顺序进行排列 方法一: print(sorted(set([chr(i) for i in range(97,123)]))) 方法二: import numpy as npa1=np.arange(97,123)b1=[chr(i) for ...
分类:
编程语言 时间:
2021-03-09 13:54:55
阅读次数:
0
Easy Hard 分析(Easy) 若$X=1$或$X=2n-1$无解,否则在正中间构造$X-1,X,X+1$, 其余位置升序铺入剩余数, 若$X-1$左侧数大于$X-1$那么$X-1$和$X$上方必定为$X$, $X+1$上方为$X+1$,可以发现比原来更接近$X$,显然到塔尖答案即为$X$ $ ...
分类:
其他好文 时间:
2021-03-06 14:41:14
阅读次数:
0
We have a collection of stones, each stone?has a positive integer weight. Each turn, we choose the two?heaviest?stones?and smash them together. Suppos ...
分类:
其他好文 时间:
2021-03-02 12:02:57
阅读次数:
0
description: There are two strings \(a\), \(b\) with the length \(n\), and \(m\). Find the Array <\(p_1, p_2, ..., p_m>\), such that \(a_{p_i}= b_i\), ...
分类:
其他好文 时间:
2021-03-01 13:26:32
阅读次数:
0
from functools import reduce list1 = [13, 22, 42, 33, 57, 32, 56, 37] tuple1 = (13, 22, 42, 33, 57, 32, 56, 37) tuple2 = (2,) list2 = [{'a': 10, 'b': ...
分类:
编程语言 时间:
2021-02-26 13:18:00
阅读次数:
0