Design a data structure that supports all following operations in average O(1) time. Note: Duplicate elements are allowed. Example: 380. Insert Delete ...
分类:
其他好文 时间:
2019-01-03 16:38:26
阅读次数:
127
Problem: Given a set of words (without duplicates), find all word squares you can build from them. A sequence of words forms a valid word square if th ...
分类:
其他好文 时间:
2019-01-01 14:05:31
阅读次数:
198
Given inorder and postorder traversal of a tree, construct the binary tree. Note:You may assume that duplicates do not exist in the tree. For example, ...
分类:
其他好文 时间:
2019-01-01 11:14:07
阅读次数:
143
Given a binary search tree (BST) with duplicates, find all the mode(s) (the most frequently occurred element) in the given BST. Assume a BST is define ...
分类:
其他好文 时间:
2018-12-30 20:18:07
阅读次数:
186
Shuffle a set of numbers without duplicates. Example: Runtime: 244 ms, faster than 36.91% of C++ online submissions for Shuffle an Array. ...
分类:
其他好文 时间:
2018-12-30 02:32:35
阅读次数:
201
Given a sorted linked list, delete all duplicates such that each element appear only once. Example 1: Example 2: time: O(n), space: O(1) ...
分类:
其他好文 时间:
2018-12-27 10:23:57
阅读次数:
118
Given an integer array with all positive numbers and no duplicates, find the number of possible combinations that add up to a positive integer target. ...
分类:
其他好文 时间:
2018-12-03 22:58:00
阅读次数:
245
https://leetcode.com/problems/summary-ranges/ Given a sorted integer array without duplicates, return the summary of its ranges. Example 1: Example 2: ...
分类:
其他好文 时间:
2018-12-02 19:16:40
阅读次数:
209
public class RemoveDuplicates { /** * 修改数组,使数组有序不重复。超出长度不考虑。 * @param 排序数组 * @return 数组不重复数的个数 */ public int removeDuplicates(int[] nums) { // 需要修改的元素... ...
分类:
编程语言 时间:
2018-12-01 23:42:20
阅读次数:
224
Given a sorted linked list, delete all duplicates such that each element appear only once. Example 1: Input: 1->1->2 Output: 1->2 Example 2: Input: 1- ...
分类:
其他好文 时间:
2018-11-29 15:19:09
阅读次数:
162