码迷,mamicode.com
首页 >  
搜索关键字:leecode duplicates    ( 1908个结果
LeetCode:删除排序数组中的重复项 (Remove Duplicates from Sorted Array)
public class RemoveDuplicates { /** * 修改数组,使数组有序不重复。超出长度不考虑。 * @param 排序数组 * @return 数组不重复数的个数 */ public int removeDuplicates(int[] nums) { // 需要修改的元素... ...
分类:编程语言   时间:2018-12-01 23:42:20    阅读次数:224
83. Remove Duplicates from Sorted List
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
【leecode】独特的电子邮件地址
每封电子邮件都由一个本地名称和一个域名组成,以 @ 符号分隔。 例如,在 alice@leetcode.com中, alice 是本地名称,而 leetcode.com 是域名。 除了小写字母,这些电子邮件还可能包含 ',' 或 '+'。 如果在电子邮件地址的本地名称部分中的某些字符之间添加句点(' ...
分类:其他好文   时间:2018-11-26 20:04:29    阅读次数:281
【leecode】宝石与石头
给定字符串J 代表石头中宝石的类型,和字符串 S代表你拥有的石头。 S 中每个字符代表了一种你拥有的石头的类型,你想知道你拥有的石头中有多少是宝石。 J 中的字母不重复,J 和 S中的所有字符都是字母。字母区分大小写,因此"a"和"A"是不同类型的石头。 You're given strings J ...
分类:其他好文   时间:2018-11-26 00:11:19    阅读次数:185
【leetcode】83-Remove Duplicates from Sorted List
problem Remove Duplicates from Sorted List 参考 1. Remove Duplicates from Sorted List; 完 ...
分类:其他好文   时间:2018-11-25 17:48:18    阅读次数:210
#Leetcode# 90. Subsets II
https://leetcode.com/problems/subsets-ii/ Given a collection of integers that might contain duplicates, nums, return all possible subsets (the power s ...
分类:其他好文   时间:2018-11-25 01:20:04    阅读次数:165
83. Remove Duplicates from Sorted List
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ class Solu... ...
分类:其他好文   时间:2018-11-24 16:43:21    阅读次数:171
[leecode]---11.container with most water
description: 思路1: 从(1,a1)开始向后算面积,需要两层n循环,时间复杂度n2 思路2: 找出数组中最大的数,将其与次大,第三大数求面积,依次类推,也需要两层循环,还需要额外排序,时间复杂度n2 因为找出最大数并且并不知道输入数据的规律(有可能很杂乱),所以每个都有必要算,采取思路 ...
分类:其他好文   时间:2018-11-24 14:10:18    阅读次数:196
#Leetcode# 47. Permutations II
https://leetcode.com/problems/permutations-ii/ Given a collection of numbers that might contain duplicates, return all possible unique permutations. E ...
分类:其他好文   时间:2018-11-23 20:47:26    阅读次数:156
Construct Binary Tree from Preorder and Inorder Traversal
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, ...
分类:其他好文   时间:2018-11-22 21:08:43    阅读次数:129
1908条   上一页 1 ... 21 22 23 24 25 ... 191 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!