| 分类 leetcode | Follow up for "Remove Duplicates":What if duplicates are allowed at most twice?For example,Given sorted array nums = [1,1,1,2,2,3],You... ...
分类:
其他好文 时间:
2020-01-29 12:53:10
阅读次数:
91
这道题虽然简单,但是需要注意的点还是比较多,首先是如果一直有重复的duplicate,要把所有的都去掉,所以inner loop是while而不是if,其次是每一层loop结束的条件,要搞清楚是head,还是head.next是不是None。 最后学习一下在python中如何建立一个class并且写 ...
分类:
其他好文 时间:
2020-01-26 10:31:56
阅读次数:
69
Given an array of integers, 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear once. Find all the elements that appear twi ...
分类:
其他好文 时间:
2020-01-24 12:08:31
阅读次数:
78
题目链接: Remove All Adjacent Duplicates In String 题目大意: 。。。。 做题报告: (1)该题涉及的算法与数据结构 。。。 (2)自己的解答思路+代码+分析时间和空间复杂度 (3)大神们的解答思路+代码+分析时间和空间复杂度 时间和空间复杂度: 时间复杂度 ...
分类:
其他好文 时间:
2020-01-22 16:23:12
阅读次数:
49
题目链接: Remove All Adjacent Duplicates In String 题目大意: 删除字符串中的所有相邻字符 做题报告: (1)该题涉及的算法与数据结构 栈,原地算法 (2)自己的解答思路+代码+分析时间和空间复杂度 Input: "abbaca" Output: "ca" ...
分类:
其他好文 时间:
2020-01-22 16:15:20
阅读次数:
82
FOR ALL ENTRIES IN 一般使用在LOOP 中有 SELECT 语句 和 JOIN 簇表的时候。 SORT LT_A BY ID. DELETE ADJACENT DUPLICATES FROM LT_A COMPARING ID. IF LT_A IS NOT INITAL. SEL ...
分类:
其他好文 时间:
2020-01-16 21:51:09
阅读次数:
113
83. 删除排序链表中的重复元素 https://leetcode cn.com/problems/remove duplicates from sorted list/ | 难度 | 完成日期 | 耗时 | 提交次数 | | | | | | | 简单 | 2020 1 16 | 0.5小时 | 2 ...
分类:
编程语言 时间:
2020-01-16 19:21:27
阅读次数:
79
Shuffle a set of numbers without duplicates. Example: // Init an array with set 1, 2, and 3. int[] nums = {1,2,3}; Solution solution = new Solution(nu ...
分类:
其他好文 时间:
2020-01-12 10:10:14
阅读次数:
101
Given an array of integers with possible duplicates, randomly output the index of a given target number. You can assume that the given target number m ...
分类:
其他好文 时间:
2020-01-12 09:53:56
阅读次数:
64
Given preorder and inorder traversal of a tree, construct the binary tree. Note:You may assume that duplicates do not exist in the tree. For example, ...
分类:
其他好文 时间:
2020-01-09 13:29:51
阅读次数:
67