自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(40)
  • 收藏
  • 关注

原创 LeetCode | 198. House Robber, 213. House Robber II, 337. House Robber III

Link: https://leetcode.com/problems/house-robber/You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them is that adjacent houses have

2023-09-11 09:24:03 343

原创 LeetCode | 139. Word Break

Link: https://leetcode.com/problems/word-break/Given a string and a dictionary of strings , return if can be segmented into a space-separated sequence of one or more dictionary words.Note that the same word in the dictionary may be reused multiple times

2023-08-29 09:39:19 184

原创 LeetCode | 322. Coin Change, 279. Perfect Squares

Link: https://leetcode.com/problems/coin-change/You are given an integer array representing coins of different denominations and an integer representing a total amount of money.Return the fewest number of coins that you need to make up that amount. If th

2023-08-29 06:55:31 178

原创 LeetCode | 518. Coin Change II, 377. Combination Sum IV

Link: https://leetcode.com/problems/coin-change-ii/You are given an integer array representing coins of different denominations and an integer representing a total amount of money.Return the number of combinations that make up that amount. If that amount

2023-08-28 07:54:01 183

原创 LeetCode | 1049. Last Stone Weight II, 494. Target Sum, 474. Ones and Zeroes

Link: https://leetcode.com/problems/last-stone-weight-ii/You are given an array of integers where is the weight of the stone.We are playing a game with the stones. On each turn, we choose any two stones and smash them together. Suppose the stones have w

2023-08-28 03:30:05 88

原创 LeetCode | 416. Partition Equal Subset Sum

Link: https://leetcode.com/problems/partition-equal-subset-sum/Given an integer array , return if you can partition the array into two subsets such that the sum of the elements in both subsets is equal or otherwise.

2023-08-26 09:58:33 48

原创 LeetCode | 343. Integer Break, 96. Unique Binary Search Trees

Link: https://leetcode.com/problems/integer-break/Given an integer , break it into the sum of positive integers, where , and maximize the product of those integers.Return the maximum product you can get.96. Unique Binary Search TreesLink: https://leetco

2023-08-25 13:06:01 51

原创 LeetCode | 62. Unique Paths, 63. Unique Paths II

Link: https://leetcode.com/problems/unique-paths/There is a robot on an grid. The robot is initially located at the top-left corner (i.e., ). The robot tries to move to the bottom-right corner (i.e., ). The robot can only move either down or right at any

2023-08-20 07:59:42 57

原创 LeetCode | 509. Fibonacci Number, 70. Climbing Stairs, 746. Min Cost Climbing Stairs

Link: https://leetcode.com/problems/fibonacci-number/The Fibonacci numbers, commonly denoted form a sequence, called the Fibonacci sequence, such that each number is the sum of the two preceding ones, starting from and . That is,Given , calculate .70.

2023-08-19 10:17:17 100

原创 LeetCode | 738. Monotone Increasing Digits

LInk: https://leetcode.com/problems/monotone-increasing-digits/An integer has monotone increasing digits if and only if each pair of adjacent digits and satisfy .Given an integer , return the largest number that is less than or equal to with monotone in

2023-08-17 12:53:31 114

原创 LeetCode | 435. Non-overlapping Intervals, 763. Partition Labels, 56. Merge Intervals

Link: https://leetcode.com/problems/non-overlapping-intervals/Given an array of intervals where , return the minimum number of intervals you need to remove to make the rest of the intervals non-overlapping.763. Partition LabelsLink: https://leetcode.com

2023-08-16 10:25:07 58

原创 LeetCode | 860. Lemonade Change, 406. Queue Reconstruction by Height, 452. Minimum Number of Arrows

Link: https://leetcode.com/problems/lemonade-change/At a lemonade stand, each lemonade costs . Customers are standing in a queue to buy from you and order one at a time (in the order specified by bills). Each customer will only buy one lemonade and pay wit

2023-08-15 11:53:04 74

原创 LeetCode | 1005. Maximize Sum Of Array After K Negations, 134. Gas Station, 135. Candy

Link: https://leetcode.com/problems/maximize-sum-of-array-after-k-negations/Given an integer array and an integer , modify the array in the following way:You should apply this process exactly times. You may choose the same index multiple times.Return th

2023-08-14 10:16:04 52

原创 LeetCode | 122. Best Time to Buy and Sell Stock II, 55. Jump Game, 45. Jump Game II

Link: https://leetcode.com/problems/best-time-to-buy-and-sell-stock-ii/You are given an integer array where is the price of a given stock on the day.On each day, you may decide to buy and/or sell the stock. You can only hold at most one share of the sto

2023-08-13 10:23:06 74

原创 LeetCode | 455. Assign Cookies, 376. Wiggle Subsequence, 53. Maximum Subarray

Link: https://leetcode.com/problems/assign-cookies/Assume you are an awesome parent and want to give your children some cookies. But, you should give each child at most one cookie.Each child has a greed factor , which is the minimum size of a cookie that

2023-08-11 12:40:45 99

原创 LeetCode | 491. Non-decreasing Subsequences, 46. Permutations, 47. Permutations II

Link: https://leetcode.com/problems/non-decreasing-subsequences/Given an integer array , return all the different possible non-decreasing subsequences of the given array with at least two elements. You may return the answer in any order.46. PermutationsL

2023-08-09 13:37:54 71

原创 LeetCode | 93. Restore IP Addresses, 78. Subsets, 90. Subsets II

Link: https://leetcode.com/problems/restore-ip-addresses/A valid IP address consists of exactly four integers separated by single dots. Each integer is between and (inclusive) and cannot have leading zeros.Given a string s containing only digits, return

2023-08-08 14:34:58 65

原创 LeetCode | 39. Combination Sum, 40. Combination Sum II, 131. Palindrome Partitioning

Link: https://leetcode.com/problems/combination-sum/Given an array of distinct integers and a integer target, return a list of all unique combinations of where the chosen numbers sum to . You may return the combinations in any order.The same number may

2023-08-07 14:43:56 78

原创 LeetCode | 216. Combination Sum III, 17. Letter Combinations of a Phone Number

Link: https://leetcode.com/problems/combination-sum-iii/Find all valid combinations of numbers that sum up to such that the following conditions are true:Return a list of all possible valid combinations. The list must not contain the same combination twi

2023-08-05 14:36:16 74

原创 LeetCode | 77. Combinations

Given two integers and , return all possible combinations of k numbers chosen from the range .You may return the answer in any order.Reference: https://programmercarl.com/

2023-08-04 04:33:45 57

原创 LeetCode | 669. Trim a BST, 108. Convert Sorted Array to BST, 538. Convert BST to Greater Tree

Link: https://leetcode.com/problems/trim-a-binary-search-tree/Given the of a binary search tree and the lowest and highest boundaries as and , trim the tree so that all its elements lies in . Trimming the tree should not change the relative structure of

2023-08-03 01:50:06 79

原创 LeetCode | 235. Lowest Common Ancestor of a BST, 701. Insert into a BST, 450. Delete Node in a BST

Link: https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-search-tree/Given a binary search tree (BST), find the lowest common ancestor (LCA) node of two given nodes in the BST.According to the definition of LCA on Wikipedia: “The lowest commo

2023-08-02 05:33:47 74

原创 LeetCode | 530.Minimum Absolute Diff in BST, 501.Find Mode in BST,236.Lowest Common Ancestor of a BT

Link: https://leetcode.com/problems/minimum-absolute-difference-in-bst/Given the of a Binary Search Tree (BST), return the minimum absolute difference between the values of any two different nodes in the tree.The result of inorder traversal of a BST is an

2023-08-01 05:19:44 58 1

原创 LeetCode | 654. Maximum BT, 617. Merge Two BT, 700. Search in a BST, 98. Validate BST

Link: https://leetcode.com/problems/maximum-binary-tree/You are given an integer array with no duplicates. A maximum binary tree can be built recursively from using the following algorithm:Return the maximum binary tree built from .617. Merge Two Binary

2023-07-31 04:35:34 39 1

原创 LeetCode | 513.Find Bottom Left Tree Value,112.Path Sum,105.Construct BT from Inorder and Postorder

Link: https://leetcode.cn/problems/find-bottom-left-tree-value/Given the of a binary tree, return the leftmost value in the last row of the tree.112. Path SumLink: https://leetcode.com/problems/path-sum/Given the of a binary tree and an integer , retur

2023-07-29 13:19:19 36

原创 LeetCode | 110. Balanced Binary Tree, 257. Binary Tree Paths, 404. Sum of Left Leaves

Link: https://leetcode.com/problems/balanced-binary-tree/Given a binary tree, determine if it is height-balanced.A height-balanced binary tree is a binary tree in which the depth of the two subtrees of every node never differs by more than one.257. Binar

2023-07-28 04:16:43 123 1

原创 LeetCode | 104. Maximum Depth of BT, 111. Minimum Depth of BT, 222. Count Complete Tree Nodes

Link: https://leetcode.com/problems/maximum-depth-of-binary-tree/Given the of a binary tree, return its maximum depth.A binary tree’s maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.The maximum

2023-07-27 03:56:56 33 1

原创 LeetCode | 102. Binary Tree Level Order Traversal, 226. Invert Binary Tree, 101. Symmetric Tree

Link: https://leetcode.com/problems/binary-tree-level-order-traversal/Given the of a binary tree, return the level order traversal of its nodes’ values. (i.e., from left to right, level by level).226. Invert Binary TreeLink: https://leetcode.com/problem

2023-07-26 12:05:24 209 1

原创 LeetCode | 144. Binary Tree Preorder Traversal, 94.BT Inorder Traversal, 145. BT Postorder Traversal

Link: https://leetcode.com/problems/binary-tree-preorder-traversal/description/Given the of a binary tree, return the preorder traversal of its nodes’ values.Traverse Order: root -> left -> right94. Binary Tree Inorder TraversalLink: https://leetcode.co

2023-07-25 02:32:52 78

原创 LeetCode | 239. Sliding Window Maximum, 347. Top K Frequent Elements

Link: https://leetcode.com/problems/sliding-window-maximum/You are given an array of integers , there is a sliding window of size which is moving from the very left of the array to the very right. You can only see the numbers in the window. Each time the

2023-07-24 04:42:51 54

原创 LeetCode | 20. Valid Parentheses, 1047. Remove All Adjacent Duplicates In String, 150.

Link: https://leetcode.com/problems/valid-parentheses/Given a string containing just the characters , , , , and , determine if the input string is valid.An input string is valid if:1047. Remove All Adjacent Duplicates In StringLink: https://leetcode.co

2023-07-22 02:13:05 114

原创 LeetCode | 232. Implement Queue using Stacks, 225. Implement Stack using Queues

Link: https://leetcode.com/problems/implement-queue-using-stacks/Implement a first in first out (FIFO) queue using only two stacks. The implemented queue should support all the functions of a normal queue (, , , and ).Implement the class:Notes:225. Imple

2023-07-21 03:24:44 118 1

原创 LeetCode | 28. Find the Index of the First Occurrence in a String, 459. Repeated Substring Pattern

Link: https://leetcode.com/problems/find-the-index-of-the-first-occurrence-in-a-string/Given two strings and , return the index of the first occurrence of in , or if is not part of .Link: https://programmercarl.com/0028.%E5%AE%9E%E7%8E%B0strStr.html45

2023-07-20 03:30:33 65

原创 LeetCode | 344. Reverse String, 541. Reverse String II, 剑05. 替换空格,151. Reverse Words in a String,剑58

Link: https://leetcode.com/problems/reverse-string/Write a function that reverses a string. The input string is given as an array of characters .You must do this by modifying the input array in-place with extra memory.541. Reverse String IILink: https:/

2023-07-19 03:50:45 101

原创 LeetCode | 454. 4Sum II, 383. Ransom Note, 15. 3Sum, 18. 4Sum

Link: https://leetcode.com/problems/4sum-ii/Given four integer arrays , , , and all of length , return the number of tuples such that:383. Ransom NoteLink: https://leetcode.com/problems/ransom-note/Given two strings and , return if can be constructe

2023-07-18 08:05:05 118 1

原创 LeetCode | 242. Valid Anagram, 349. Intersection of Two Arrays, 202. Happy Number, 1. Two Sum

Link: https://leetcode.com/problems/valid-anagram/Given two strings and , return if is an anagram of , and otherwise.An Anagram is a word or phrase formed by rearranging the letters of a different word or phrase, typically using all the original letter

2023-07-17 04:23:40 112 1

原创 LeetCode | 24, 19, 160, 142

Link: https://leetcode.com/problems/swap-nodes-in-pairs/Given a linked list, swap every two adjacent nodes and return its head. You must solve the problem without modifying the values in the list’s nodes (i.e., only nodes themselves may be changed.Remark

2023-07-15 06:24:39 94 1

原创 LeetCode | 203. Remove Linked List Elements, 707. Design Linked List, 206. Reverse Linked List

Link: https://leetcode.com/problems/remove-linked-list-elements/Given the of a linked list and an integer , remove all the nodes of the linked list that has , and return the new .RemarkUse dummy head.707. Design Linked ListDescriptionDesign your im

2023-07-14 03:51:38 317 1

原创 LeetCode | 977.Squares of a Sorted Array, 209. Minimum Size Subarray Sum, 59. Spiral Matrix II

Link: https://leetcode.com/problems/squares-of-a-sorted-array/Given an integer array sorted in non-decreasing order, return an array of the squares of each number sorted in non-decreasing order.209. Minimum Size Subarray SumLink: https://leetcode.com/pr

2023-07-13 03:26:00 214 1

原创 LeetCode | 704. Binary Search, 27. Remove Element

Link: https://leetcode.com/problems/binary-search/Reference: https://programmercarl.com/0704.%E4%BA%8C%E5%88%86%E6%9F%A5%E6%89%BE.htmlGiven an array of integers which is sorted in ascending order, and an integer , write a function to search in . If exi

2023-07-12 04:30:02 700 1

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除