*博客头图：

RGB颜色，例如：#AFAFAF

Hover：

RGB颜色，例如：#AFAFAF

RGB颜色，例如：#AFAFAF

qq_37821701的博客

• 博客(238)
• 收藏
• 关注

原创 1419. Minimum Number of Frogs Croaking (python)

2020-11-27 12:27:52 20

原创 Leetcode 1424. Diagonal Traverse II (python)

2020-11-26 05:50:10 52

原创 Leetcode 1423. Maximum Points You Can Obtain from Cards (python)

2020-11-26 05:38:52 61

原创 Leetcode 1438. Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit (python)

2020-11-23 08:56:28 18

原创 Leetcode 1442. Count Triplets That Can Form Two Arrays of Equal XOR (python)

2020-11-22 11:16:22 10

原创 Leetcode 1443. Minimum Time to Collect All Apples in a Tree (python)

2020-11-22 10:51:11 8

原创 Leetcode 1452. People Whose List of Favorite Companies Is Not a Subset of Another List (python)

2020-11-20 11:37:52 6

原创 Leetcode 1451. Rearrange Words in a Sentence (python)

2020-11-20 11:33:46 8

原创 Leetcode 1457. Pseudo-Palindromic Paths in a Binary Tree (python)

2020-11-19 11:01:59 8

原创 Leetcode 1456. Maximum Number of Vowels in a Substring of Given Length (python)

2020-11-19 10:56:34 12

原创 Leetcode 74. Search a 2D Matrix (python+cpp)

2020-11-18 14:30:06 3

原创 Leetcode 1466. Reorder Routes to Make All Paths Lead to the City Zero (python)

2020-11-18 14:09:27 14

原创 Leetcode 149. Max Points on a Line (python)

2020-11-17 14:31:22 8

原创 Leetcode 1472. Design Browser History (python)

2020-11-17 06:49:28 12

原创 1482. Minimum Number of Days to Make m Bouquets (python+cpp)

2020-11-16 12:43:31 57

原创 Leetcode 1515. Best Position for a Service Centre (python)

2020-11-13 10:49:42 15

原创 Leetcode 1488. Avoid Flood in The City（python）

2020-11-12 09:35:28 46

原创 Leetcode 1487. Making File Names Unique (python)

2020-11-12 09:29:14 43 2

原创 Leetcode 1498. Number of Subsequences That Satisfy the Given Sum Condition (python)

2020-11-11 10:24:01 44

原创 Leetcode 1497. Check If Array Pairs Are Divisible by k (python)

2020-11-11 10:22:15 44

原创 Leetcode 1504. Count Submatrices With All Ones (python)

2020-11-11 03:33:29 31

原创 Leetcode 1514. Path with Maximum Probability (python)

2020-11-06 10:51:40 54

原创 Leetcode 1519. Number of Nodes in the Sub-Tree With the Same Label (python)

2020-11-05 10:40:14 49

原创 Leetcode 1529. Bulb Switcher IV (python)

2020-11-05 07:07:23 18

原创 Leetcode 1530. Number of Good Leaf Nodes Pairs (python)

2020-11-05 06:57:41 70

原创 Leetcode 1535. Find the Winner of an Array Game (python)

2020-11-03 09:00:49 9

原创 Leetcode 1536. Minimum Swaps to Arrange a Binary Grid (python)

2020-11-03 08:57:11 215

原创 Leetcode 529. Minesweeper (python)

2020-11-02 15:34:04 44

原创 Leetcode 1545. Find Kth Bit in Nth Binary String (python)

2020-11-02 06:38:57 45

原创 Leetcode 1546. Maximum Number of Non-Overlapping Subarrays With Sum Equals Target (python)

2020-11-02 06:30:20 22

原创 Leetcode 二分判定类题目 (python)

2020-11-01 05:52:33 19

原创 Leetcode 977. Squares of a Sorted Array (C++)

2020-10-29 13:52:33 15

原创 Leetcode 44. Wildcard Matching & Regular Expression Matching (python)

Leetcode 44. Wildcard Matching解法：动态规划这道题目在于理解代码中的step2和step4的第一部分关于step 4的第一步份，实际上可以用0，1背包跟完全背包之前的关系来理解class Solution {public: bool isMatch(string s, string p) { int sl = s.length(); int pl = p.length(); // step1:

2020-10-29 13:48:23 14

原创 Leetcode 1562. Find Latest Group of Size M (python)

Leetcode 1562. Find Latest Group of Size M题目解法1：TLE解法2：题目解法1：TLE自己开始想出来的非常复杂的解法，还是TLE了，主要T在从list里面删除元素class Solution: def findLatestStep(self, arr: List[int], m: int) -> int: ans = -1 pos2len = {} len2pos = collections.d

2020-10-28 12:37:24 37

原创 Leetcode 1561. Maximum Number of Coins You Can Get

Leetcode 1561. Maximum Number of Coins You Can Get题目解法1：heap解法2：sort题目解法1：heap这道题的规律是，每次取剩下堆中的最大的两个值和最小的值组成triplet就可以，剩下的只是实现问题。当时自己做的时候是用一个最大堆和一个最小堆实现的，其实这样比较慢class Solution: def maxCoins(self, piles: List[int]) -> int: min_heap = pile

2020-10-28 12:24:10 30

原创 Leetcode 1560. Most Visited Sector in a Circular Track (python)

Leetcode 1560. Most Visited Sector in a Circular Track题目解法：brutal force解法2：题目解法：brutal force没有仔细思考规律就是写的这么丑陋class Solution: def mostVisited(self, n: int, rounds: List[int]) -> List[int]: d = collections.defaultdict(int) for i in

2020-10-28 09:53:13 36

原创 Leetcode 1630. Arithmetic Subarrays (python)

Leetcode 1630. Arithmetic Subarrays题目解法1：sort解法2：利用set题目解法1：sortclass Solution: def checkArithmeticSubarrays(self, nums: List[int], l: List[int], r: List[int]) -> List[bool]: def check(array): array.sort() dis = a

2020-10-27 09:59:54 59

原创 Leetcode 1631 Path With Minimum Effort (python)

Leetcode Path With Minimum Effort题目解析follow up题目解析这个题目再Leetcode 的problems里面还没有，只出现在Weekly contest 212的第3题一开始觉得这个题目是个DP，觉得两遍dp可以做，实际上思路错了，两个方向的dp是不行的。基本上看到四个方向可走的题目就是用最短路径问题来做，最短路径这边也提供两种做法，一种是Bellman ford，另一种是Dijkstra，关于两种做法的详细解释看这题 Leetcode The Ma

2020-10-27 09:41:43 35

原创 Leetcode 1568. Minimum Number of Days to Disconnect Island (python)

Leetcode 1568. Minimum Number of Days to Disconnect Island题目解析：题目解析：这道题目的关键就在于，想到只有可能是0，1，2三种答案，想到了这个题目也就非常简单了class Solution: def minDays(self, grid: List[List[int]]) -> int: # check if there is more than one disconnected islands in teh

2020-10-27 07:44:44 28

原创 Leetcode 1567. Maximum Length of Subarray With Positive Product (python)

Leetcode 1567. Maximum Length of Subarray With Positive Product题目：解法1：解法2：two pass题目：解法1：这种判断正负的题目往往都是通过正负得负，负负得正这样的方式来进行交换得到的，之前也有过类似的题目：比如Leetcode 152 Maximum Product Subarray这题具体的解析如下：The main idea here is to keep a count of running positive array

2020-10-25 06:12:33 18

空空如也

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

TA关注的人 TA的粉丝