随笔分类 - LeetCode(Java)
摘要:LeetCode 455. Assign Cookies (分发饼干) 题目 链接 https://leetcode.cn/problems/assign-cookies/ 问题描述 对每个孩子 i,都有一个胃口值 g[i],这是能让孩子们满足胃口的饼干的最小尺寸;并且每块饼干 j,都有一个尺寸 s
阅读全文
摘要:LeetCode 37. Sudoku Solver (解数独) 题目 链接 https://leetcode.cn/problems/sudoku-solver/ 问题描述 编写一个程序,通过填充空格来解决数独问题。 数独的解法需 遵循如下规则: 数字 1-9 在每一行只能出现一次。 数字 1-9
阅读全文
摘要:LeetCode 491. Increasing Subsequences (递增子序列) 题目 链接 https://leetcode.cn/problems/increasing-subsequences/ 问题描述 给你一个整数数组 nums ,找出并返回所有该数组中不同的递增子序列,递增子序
阅读全文
摘要:LeetCode 47. Permutations II (全排列II) 题目 链接 https://leetcode.cn/problems/permutations-ii/ 问题描述 给定一个可包含重复数字的序列 nums ,按任意顺序 返回所有不重复的全排列。 示例 输入:nums = [1,
阅读全文
摘要:LeetCode 90. Subsets II (子集 II) 题目 链接 https://leetcode.cn/problems/subsets-ii/ 问题描述 给你一个整数数组 nums ,其中可能包含重复元素,请你返回该数组所有可能的子集(幂集)。 解集 不能 包含重复的子集。返回的解集中
阅读全文
摘要:LeetCode 78. Subsets (子集) 题目 链接 https://leetcode.cn/problems/subsets/ 问题描述 给你一个整数数组 nums ,数组中的元素 互不相同 。返回该数组所有可能的子集(幂集)。 解集 不能 包含重复的子集。你可以按 任意顺序 返回解集。
阅读全文
摘要:LeetCode 93. Restore IP Addresses (复原 IP 地址) 题目 链接 https://leetcode.cn/problems/restore-ip-addresses/ 问题描述 有效 IP 地址 正好由四个整数(每个整数位于 0 到 255 之间组成,且不能含有前
阅读全文
摘要:LeetCode 131. Palindrome Partitioning (分割回文串) 题目 链接 https://leetcode.cn/problems/palindrome-partitioning/ 问题描述 给你一个字符串 s,请你将 s 分割成一些子串,使每个子串都是 回文串 。返回
阅读全文
摘要:LeetCode 40. Combination Sum II (组合总和 II) 题目 链接 https://leetcode.cn/problems/combination-sum-ii/ 问题描述 给定一个候选人编号的集合 candidates 和一个目标数 target ,找出 candid
阅读全文
摘要:LeetCode 39. Combination Sum (组合总和) 题目 链接 https://leetcode.cn/problems/combination-sum/ 问题描述 给你一个 无重复元素 的整数数组 candidates 和一个目标整数 target ,找出 candidates
阅读全文
摘要:LeetCode 17. Letter Combinations of a Phone Number (电话号码的字母组合) 题目 链接 https://leetcode.cn/problems/letter-combinations-of-a-phone-number/ 问题描述 给定一个仅包含数
阅读全文
摘要:LeetCode 216. Combination Sum III (组合总和 III) 题目 链接 https://leetcode.cn/problems/combination-sum-iii/ 问题描述 找出所有相加之和为 n 的 k 个数的组合,且满足下列条件: 只使用数字1到9 每个数字
阅读全文
摘要:LeetCode 77. Combinations (组合) 题目 链接 https://leetcode.cn/problems/combinations/ 问题描述 你可以按 任何顺序 返回答案。 示例 输入:n = 4, k = 2 输出: [ [2,4], [3,4], [2,3], [1,
阅读全文
摘要:LeetCode 669. Trim a Binary Search Tree (修剪二叉搜索树) 题目 链接 https://leetcode.cn/problems/trim-a-binary-search-tree/ 问题描述 给你二叉搜索树的根节点 root ,同时给定最小边界low 和最大
阅读全文
摘要:LeetCode 450. Delete Node in a BST (删除二叉搜索树中的节点) 题目 链接 https://leetcode.cn/problems/delete-node-in-a-bst/ 问题描述 给定一个二叉搜索树的根节点 root 和一个值 key,删除二叉搜索树中的 k
阅读全文
摘要:LeetCode 108. Convert Sorted Array to Binary Search Tree (将有序数组转换为二叉搜索树) 题目 链接 https://leetcode.cn/problems/convert-sorted-array-to-binary-search-tree
阅读全文
摘要:LeetCode 701. Insert into a Binary Search Tree (二叉搜索树中的插入操作) 题目 链接 https://leetcode.cn/problems/insert-into-a-binary-search-tree/ 问题描述 给定二叉搜索树(BST)的根节
阅读全文
摘要:LeetCode 235. Lowest Common Ancestor of a Binary Search Tree (二叉搜索树的最近公共祖先) 题目 链接 https://leetcode.cn/problems/lowest-common-ancestor-of-a-binary-sear
阅读全文
摘要:LeetCode 236. Lowest Common Ancestor of a Binary Tree (二叉树的最近公共祖先) 题目 链接 https://leetcode.cn/problems/lowest-common-ancestor-of-a-binary-tree/ 问题描述 给定
阅读全文
摘要:LeetCode 501. Find Mode in Binary Search Tree (二叉搜索树中的众数) 题目 链接 https://leetcode.cn/problems/find-mode-in-binary-search-tree/ 问题描述 给你一个含重复值的二叉搜索树(BST)
阅读全文