随笔分类 - LeetCode(Java)
摘要:LeetCode 2006. Count Number of Pairs With Absolute Difference K (差的绝对值为 K 的数对数目) 题目 链接 https://leetcode-cn.com/problems/count-number-of-pairs-with-abs
阅读全文
摘要:LeetCode 2000. Reverse Prefix of Word (反转单词前缀) 题目 链接 https://leetcode-cn.com/problems/reverse-prefix-of-word/ 问题描述 给你一个下标从 0 开始的字符串 word 和一个字符 ch 。找出
阅读全文
摘要:LeetCode 1763. Longest Nice Substring (最长的美好子字符串) 题目 链接 https://leetcode-cn.com/problems/longest-nice-substring/ 问题描述 当一个字符串 s 包含的每一种字母的大写和小写形式 同时 出现在
阅读全文
摘要:LeetCode 539. Minimum Time Difference(最小时间差) 题目 链接 https://leetcode-cn.com/problems/minimum-time-difference/ 问题描述 给定一个 24 小时制(小时:分钟 "HH:MM" )的时间列表,找出列
阅读全文
摘要:LeetCode 747. Largest Number At Least Twice of Others(至少是其他数字两倍的最大数) 题目 链接 https://leetcode-cn.com/problems/largest-number-at-least-twice-of-others/ 问
阅读全文
摘要:945. Minimum Increment to Make Array Unique (使数组唯一的最小增量) 链接 https://leetcode cn.com/problems/minimum increment to make array unique 题目 给定整数数组 A,每次 mov
阅读全文
摘要:365. Water and Jug Problem (水壶问题) 链接 https://leetcode cn.com/problems/water and jug problem/ 题目 有两个容量分别为 x升 和 y升 的水壶以及无限多的水。请判断能否通过使用这两个水壶,从而可以得到恰好 z升
阅读全文
摘要:面试题40. 最小的k个数 链接 https://leetcode cn.com/problems/zui xiao de kge shu lcof/ 题目 输入整数数组 arr ,找出其中最小的 k 个数。例如,输入4、5、1、6、2、7、3、8这8个数字,则最小的4个数字是1、2、3、4。 示例
阅读全文
摘要:409. Longest Palindrome(最长回文串) 链接 https://leetcode cn.com/problems/longest palindrome/ 题目 给定一个包含大写字母和小写字母的字符串,找到通过这些字母构造成的最长的回文串。 在构造过程中,请注意区分大小写。比如 "
阅读全文
摘要:543. Diameter of Binary Tree(二叉树的直径) 链接 https://leetcode cn.com/problems/diameter of binary tree 题目 给定一棵二叉树,你需要计算它的直径长度。一棵二叉树的直径长度是任意两个结点路径长度中的最大值。这条路
阅读全文
摘要:234. Palindrome Linked List(回文链表) 链接 https://leetcode cn.com/problems/palindrome linked list 题目 请判断一个链表是否为回文链表。 示例 1: 输入: 1 2 输出: false 示例 2: 输入: 1 2
阅读全文
摘要:LeetCode 206. Reverse Linked List (反转链表) 题目 链接 https://leetcode-cn.com/problems/reverse-linked-list/ 问题描述 反转一个单链表。 示例 输入: 1->2->3->4->5->NULL 输出: 5->4
阅读全文
摘要:LeetCode 160. Intersection of Two Linked Lists(相交链表) 题目 链接 https://leetcode-cn.com/problems/intersection-of-two-linked-lists 问题描述 给你两个单链表的头节点 headA 和
阅读全文
摘要:1160. Find Words That Can Be Formed by Characters(拼写单词) 链接 https://leetcode cn.com/problems/find words that can be formed by characters 题目 给你一份『词汇表』(字
阅读全文
摘要:面试题 01.06. Compress String LCCI(字符串压缩) 链接 https://leetcode cn.com/problems/compress string lcci 题目 字符串压缩。利用字符重复出现的次数,编写一种方法,实现基本的字符串压缩功能。比如,字符串aabcccc
阅读全文
摘要:1038. Binary Search Tree to Greater Sum Tree(从二叉搜索树到更大和树) 链接 https://leetcode cn.com/problems/binary search tree to greater sum tree/ 题目 给出二叉 搜索 树的根节点
阅读全文
摘要:538. Convert BST to Greater Tree(把二叉搜索树转换为累加树) 链接 https://leetcode cn.com/problems/convert bst to greater tree 题目 给定一个二叉搜索树(Binary Search Tree),把它转换成为
阅读全文
摘要:141. Linked List Cycle(环形链表) 链接 https://leetcode cn.com/problems/linked list cycle 题目 给定一个链表,判断链表中是否有环。 为了表示给定链表中的环,我们使用整数 pos 来表示链表尾连接到链表中的位置(索引从 0 开
阅读全文
摘要:155. Min Stack(最小栈) 链接 https://leetcode cn.com/problems/min stack 题目 设计一个支持 push,pop,top 操作,并能在常数时间内检索到最小元素的栈。 push(x) 将元素 x 推入栈中。 pop() 删除栈顶的元素。 top(
阅读全文
摘要:300. Longest Increasing Subsequence(最长上升子序列) 链接 https://leetcode cn.com/problems/merge two binary trees 题目 给定一个无序的整数数组,找到其中最长上升子序列的长度。 示例: 输入: [10,9,2
阅读全文

浙公网安备 33010602011771号