码迷,mamicode.com
首页 >  
搜索关键字:leetcode 19    ( 34993个结果
开散列表
实现的结构和闭散列表完全一致,由于开散列表没有扩容机制,因此在创建散列表时要大概估计适合的散列表大小。 另外就是理论上插入到同一个散列表的键值是不能重复的,否则会造成查询和删除时的错误。(leetcode第一题两数之和是可能存在重复键值的,要考虑如何做特殊处理) #include <iostream ...
分类:其他好文   时间:2020-08-17 17:12:29    阅读次数:71
LeetCode 546. 移除盒子 | Python
546. 移除盒子 题目 给出一些不同颜色的盒子,盒子的颜色由数字表示,即不同的数字表示不同的颜色。 你将经过若干轮操作去去掉盒子,直到所有的盒子都去掉为止。每一轮你可以移除具有相同颜色的连续 k 个盒子(k >= 1),这样一轮之后你将得到 k*k 个积分。 当你将所有盒子都去掉之后,求你能获得的 ...
分类:编程语言   时间:2020-08-15 22:38:39    阅读次数:67
LeetCode——合并K个排序链表
题目地址:https://leetcode-cn.com/problems/merge-k-sorted-lists/ 解题思路:简单的分治算法 /** * Definition for singly-linked list. * struct ListNode { * int val; * Lis ...
分类:编程语言   时间:2020-08-15 22:27:55    阅读次数:64
leetcode刷题-94二叉树的中序遍历
题目 给定一个二叉树,返回它的中序 遍历。 实现 # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution: def inorderTraversal(self, roo ...
分类:其他好文   时间:2020-08-15 22:23:27    阅读次数:69
【LeetCode-字符串】打印从1到最大的n位数
题目描述 输入数字 n,按顺序打印出从 1 到最大的 n 位十进制数。比如输入 3,则打印出 1、2、3 一直到最大的 3 位数 999。 示例: 输入: n = 1 输出: [1,2,3,4,5,6,7,8,9] 题目链接: https://leetcode-cn.com/problems/da- ...
分类:其他好文   时间:2020-08-13 22:09:34    阅读次数:65
每日一道 LeetCode (15):二进制求和
每天 3 分钟,走上算法的逆袭之路。 前文合集 每日一道 LeetCode 前文合集 代码仓库 GitHub: https://github.com/meteor1993/LeetCode Gitee: https://gitee.com/inwsy/LeetCode 题目:数组加一 题目来源:ht ...
分类:其他好文   时间:2020-08-12 15:48:49    阅读次数:54
Leetcode.76 Minimum Window Substring (Java)
Leetcode.76 Minimum Window Substring Given a string S and a string T, find the minimum window in S which will contain all the characters in T in compl ...
分类:编程语言   时间:2020-08-11 15:56:40    阅读次数:64
[LeetCode] 3. 无重复字符的最长子串
给定一个字符串,请你找出其中不含有重复字符的 **最长子串** 的长度。 输入: "abcabcbb" 输出: 3 解释: 因为无重复字符的最长子串是 "abc",所以其长度为 3。 输入: "bbbbb" 输出: 1 解释: 因为无重复字符的最长子串是 "b",所以其长度为 1。 输入: "pww ...
分类:其他好文   时间:2020-08-11 00:27:43    阅读次数:68
LeetCode 93. 复原IP地址
我的LeetCode:https://leetcode-cn.com/u/ituring/ 我的LeetCode刷题源码[GitHub]:https://github.com/izhoujie/Algorithmcii LeetCode 93. 复原IP地址 题目 给定一个只包含数字的字符串,复原它 ...
分类:其他好文   时间:2020-08-11 00:24:44    阅读次数:70
【LeetCode/LintCode】 题解丨字节跳动试题:第k大的子数组
给定一个长度为n的数组a,它有n(n+1)/2??个子数组。请计算这些子数组的和,然后按照升序排列,并返回排序后第k个数。 1≤n≤10?^5 1≤a?i≤10^?9 1≤k≤?n(n+1)/2 在线评测地址:点击此处前往 Example1 Input: [2,3,1,4] 6 Output:5 E ...
分类:编程语言   时间:2020-08-10 11:03:25    阅读次数:93
34993条   上一页 1 ... 79 80 81 82 83 ... 3500 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!