随笔分类 - leetCode hot 100
摘要:https://www.cnblogs.com/MarkLeeBYR/p/17166229.html
阅读全文
摘要:Given a non-empty array containing only positive integers, find if the array can be partitioned into two subsets such that the sum of elements in both
阅读全文
摘要:Given an unsorted array of integers, find the number of longest increasing subsequence. Example 1: Input: [1,3,5,4,7] Output: 2 Explanation: The two l
阅读全文
摘要:Given a non-empty array of integers, return the k most frequent elements. Example 1: Input: nums = [1,1,1,2,2,3], k = 2 Output: [1,2] Example 2: Input
阅读全文
摘要:Example 1: Input: coins = [1,2,5], amount = 11 Output: 3 Explanation: 11 = 5 + 5 + 1 Example 2: Input: coins = [2], amount = 3 Output: -1 Example 3: I
阅读全文
摘要:Given an integer array nums, return the length of the longest strictly increasing subsequence. Example 1: Input: nums = [10,9,2,5,3,7,101,18] Output:
阅读全文
摘要:剑指offer https://www.cnblogs.com/MarkLeeBYR/p/9773495.html
阅读全文
摘要:剑指offer 数组中的重复数字 https://www.cnblogs.com/MarkLeeBYR/p/9773954.html
阅读全文
摘要:Given an array nums, write a function to move all 0's to the end of it while maintaining the relative order of the non-zero elements. For example, giv
阅读全文
摘要:Given a positive integer n, find the least number of perfect square numbers (for example, 1, 4, 9, 16, ...) which sum to n. For example, given n = 12,
阅读全文
摘要:剑指offer 二维数组的查找 https://www.cnblogs.com/MarkLeeBYR/p/9777341.html
阅读全文
摘要:剑指offer 构建乘积数组 https://www.cnblogs.com/MarkLeeBYR/p/9773723.html
阅读全文
摘要:给定一个二叉树和所要查找的两个节点,找到两个节点的最近公共父亲节点(LCA)。比如,节点5和1的LCA是3,节点5和4的LCA是5。 class Solution { public TreeNode lowestCommonAncestor(TreeNode root, TreeNode p, Tr
阅读全文
摘要:Example 1: Input: head = [1,2,2,1] Output: true Example 2: Input: head = [1,2] Output: false public boolean isPalindrome(ListNode head) { ListNode mid
阅读全文
摘要:剑指offer 二叉搜索树的第k个节点 https://www.cnblogs.com/MarkLeeBYR/p/9773509.html
阅读全文
摘要:剑指offer https://www.cnblogs.com/MarkLeeBYR/p/9776556.html
阅读全文
摘要:参考剑指offer 最小的k个数字 https://www.cnblogs.com/MarkLeeBYR/p/9775091.html
阅读全文
摘要:Implement a trie with insert, search, and startsWith methods. Note:You may assume that all inputs are consist of lowercase letters a-z. class TrieNode
阅读全文
摘要:剑指offer 反转链表 https://www.cnblogs.com/MarkLeeBYR/p/9773053.html
阅读全文
摘要:Given an m x n 2D binary grid grid which represents a map of '1's (land) and '0's (water), return the number of islands. An island is surrounded by wa
阅读全文