<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[Tc的专栏]]></title><description><![CDATA[道阻且长 行则将至]]></description><link>https://blog.csdn.net/Tc_To_Top</link><language>zh-cn</language><generator>https://blog.csdn.net/</generator><copyright><![CDATA[Copyright &copy; Tc_To_Top]]></copyright><item><title><![CDATA[LeetCode 1477 Find Two Non-overlapping Sub-arrays Each With Target Sum (滑动窗)]]></title><link>https://blog.csdn.net/Tc_To_Top/article/details/135271285</link><guid>https://blog.csdn.net/Tc_To_Top/article/details/135271285</guid><author>Tc_To_Top</author><pubDate>Thu, 28 Dec 2023 15:47:18 +0800</pubDate><description><![CDATA[题目分析：像这种求两段不重复的问题很容易想到分别从左往右，从右往左计算答案再枚举中点。题目大意：求两段不重复的和为target的子串的最小长度和。]]></description><category></category></item><item><title><![CDATA[LeetCode 1765 Map of Highest Peak (多源点BFS 推荐)]]></title><link>https://blog.csdn.net/Tc_To_Top/article/details/126756000</link><guid>https://blog.csdn.net/Tc_To_Top/article/details/126756000</guid><author>Tc_To_Top</author><pubDate>Wed, 07 Sep 2022 23:44:49 +0800</pubDate><description><![CDATA[题目分析：多源点bfs，将水的位置都作为源点，每次向四个方向扩散，高度加1，开始一直在想这么做有没有可能出现违反高度差不超过1的限制。其实是不可能的，因为bfs是用队列维护的，特点是先进先出，换句话说，假设当前队首的高度为h，队尾的高度为h+1，不可能出现队尾高度仍为h但队尾高度为h+2的情况，因为处理h+2的前提是所有高度为h的都已处理完毕。题目大意：n*m的矩阵，水的高度为0，地的高度大于0，且要求相邻两个高度差不能超过1，求一种排列方式使得其中的最大值最大。65ms，时间击败91.58%]]></description><category></category></item><item><title><![CDATA[LeetCode 992 Subarrays with K Different Integers (滑动窗 推荐)]]></title><link>https://blog.csdn.net/Tc_To_Top/article/details/126737738</link><guid>https://blog.csdn.net/Tc_To_Top/article/details/126737738</guid><author>Tc_To_Top</author><pubDate>Wed, 07 Sep 2022 08:39:54 +0800</pubDate><description><![CDATA[题目分析：恰好有k个不好求，但至多有k个则非常容易，恰好k个=至多k个-至多k-1个，至多有k个可以用滑动窗，用hash判断每个数字出现的次数，并用一个值记录当前有多少个不同的数字。题目大意：求恰好有k个不同数字的区间个数。13ms，时间击败88.84%]]></description><category></category></item><item><title><![CDATA[LeetCode 2400 Number of Ways to Reach a Position After Exactly k Steps (dp 或 组合数 推荐)]]></title><link>https://blog.csdn.net/Tc_To_Top/article/details/126733105</link><guid>https://blog.csdn.net/Tc_To_Top/article/details/126733105</guid><author>Tc_To_Top</author><pubDate>Tue, 06 Sep 2022 21:17:10 +0800</pubDate><description><![CDATA[联立得x = (endPos - startPos + k) / 2，答案即为C(n, x)，取模需要用到除法逆元，由费马小定理a^(p - 1) ≡ 1 mod p。题目分析：最容易想到的是记忆化搜索，dp[i][j]表示从位置i到终点走k步的方案数。设向右走x步，向左走y步，假设endPos比startPos大则。题目大意：直线给两点，从起点到终点走k步的方案数。94ms，时间击败82.98%2ms，时间击败98.14%]]></description><category></category></item><item><title><![CDATA[LeetCode 1423 Maximum Points You Can Obtain from Cards (前缀和)]]></title><link>https://blog.csdn.net/Tc_To_Top/article/details/124676663</link><guid>https://blog.csdn.net/Tc_To_Top/article/details/124676663</guid><author>Tc_To_Top</author><pubDate>Mon, 09 May 2022 22:36:24 +0800</pubDate><description><![CDATA[There are several cardsarranged in a row, and each card has an associated number of points. The points are given in the integer arraycardPoints.

In one step, you can take one card from the beginning or from the end of the row. You have to take exactlyk...]]></description><category></category></item><item><title><![CDATA[LeetCode 1383 Maximum Performance of a Team (优先队列 贪心 推荐)]]></title><link>https://blog.csdn.net/Tc_To_Top/article/details/124653694</link><guid>https://blog.csdn.net/Tc_To_Top/article/details/124653694</guid><author>Tc_To_Top</author><pubDate>Sun, 08 May 2022 20:22:54 +0800</pubDate><description><![CDATA[You are given two integersnandkand two integer arraysspeedandefficiencyboth of lengthn. There arenengineers numbered from1ton.speed[i]andefficiency[i]represent the speed and efficiency of theithengineer respectively.

Chooseat mostkd...]]></description><category></category></item><item><title><![CDATA[LeetCode 1300 Sum of Mutated Array Closest to Target (前缀和 二分)]]></title><link>https://blog.csdn.net/Tc_To_Top/article/details/124651661</link><guid>https://blog.csdn.net/Tc_To_Top/article/details/124651661</guid><author>Tc_To_Top</author><pubDate>Sun, 08 May 2022 17:57:20 +0800</pubDate><description><![CDATA[Given an integer arrayarrand a target valuetarget, return the integervaluesuch that when we change all the integers larger thanvaluein the given array to be equal tovalue, the sum of the array gets as close as possible (in absolute difference) tot...]]></description><category></category></item><item><title><![CDATA[LeetCode 1721 Swapping Nodes in a Linked List (链表 快慢指针)]]></title><link>https://blog.csdn.net/Tc_To_Top/article/details/124639679</link><guid>https://blog.csdn.net/Tc_To_Top/article/details/124639679</guid><author>Tc_To_Top</author><pubDate>Sat, 07 May 2022 21:24:15 +0800</pubDate><description><![CDATA[You are given theheadof a linked list, and an integerk.

Returnthe head of the linked list afterswappingthe values of thekthnode from the beginning and thekthnode from the end (the list is1-indexed).

Example 1:




Input: head = [1,2,3,4,5], k ...]]></description><category></category></item><item><title><![CDATA[LeetCode 994 Rotting Oranges (bfs 推荐)]]></title><link>https://blog.csdn.net/Tc_To_Top/article/details/124633393</link><guid>https://blog.csdn.net/Tc_To_Top/article/details/124633393</guid><author>Tc_To_Top</author><pubDate>Sat, 07 May 2022 16:19:35 +0800</pubDate><description><![CDATA[You are given anm x ngridwhere each cell can have one of three values:

0representing an empty cell,
	1representing a fresh orange, or
	2representing a rotten orange.
Every minute, any fresh orange that is4-directionally adjacentto a rotten orange ...]]></description><category></category></item><item><title><![CDATA[LeetCode 452 Minimum Number of Arrows to Burst Balloons (贪心，排序)]]></title><link>https://blog.csdn.net/Tc_To_Top/article/details/124631595</link><guid>https://blog.csdn.net/Tc_To_Top/article/details/124631595</guid><author>Tc_To_Top</author><pubDate>Sat, 07 May 2022 15:53:14 +0800</pubDate><description><![CDATA[There are some spherical balloons taped onto a flat wall that represents the XY-plane. The balloons are represented as a 2D integer arraypointswherepoints[i] = [xstart, xend]denotes a balloon whosehorizontal diameterstretches betweenxstartandxend....]]></description><category></category></item><item><title><![CDATA[LeetCode 1035 Uncrossed Lines（dp 推荐）]]></title><link>https://blog.csdn.net/Tc_To_Top/article/details/124624959</link><guid>https://blog.csdn.net/Tc_To_Top/article/details/124624959</guid><author>Tc_To_Top</author><pubDate>Sat, 07 May 2022 10:13:48 +0800</pubDate><description><![CDATA[You are given two integer arraysnums1andnums2. We write the integers ofnums1andnums2(in the order they are given) on two separate horizontal lines.

We may draw connecting lines: a straight line connecting two numbersnums1[i]andnums2[j]such that...]]></description><category></category></item><item><title><![CDATA[LeetCode 2131 Longest Palindrome by Concatenating Two Letter Words (hash)]]></title><link>https://blog.csdn.net/Tc_To_Top/article/details/124596173</link><guid>https://blog.csdn.net/Tc_To_Top/article/details/124596173</guid><author>Tc_To_Top</author><pubDate>Thu, 05 May 2022 19:58:47 +0800</pubDate><description><![CDATA[You are given an array of stringswords. Each element ofwordsconsists oftwolowercase English letters.

Create thelongest possible palindromeby selecting some elements fromwordsand concatenating them inany order. Each element can be selectedat mos...]]></description><category></category></item><item><title><![CDATA[LeetCode 838 Push Dominoes (二点法，模拟)]]></title><link>https://blog.csdn.net/Tc_To_Top/article/details/124515790</link><guid>https://blog.csdn.net/Tc_To_Top/article/details/124515790</guid><author>Tc_To_Top</author><pubDate>Sat, 30 Apr 2022 17:37:43 +0800</pubDate><description><![CDATA[There arendominoes in a line, and we place each domino vertically upright. In the beginning, we simultaneously push some of the dominoes either to the left or to the right.

After each second, each domino that is falling to the left pushes the adjacent d..]]></description><category></category></item><item><title><![CDATA[LeetCode 1590 Make Sum Divisible by P (前缀和 hash)]]></title><link>https://blog.csdn.net/Tc_To_Top/article/details/123947314</link><guid>https://blog.csdn.net/Tc_To_Top/article/details/123947314</guid><author>Tc_To_Top</author><pubDate>Sun, 03 Apr 2022 23:48:56 +0800</pubDate><description><![CDATA[Given an array of positive integersnums, remove thesmallestsubarray (possiblyempty) such that thesumof the remaining elements is divisible byp. It isnotallowed to remove the whole array.

Returnthe length of the smallest subarray that you need to...]]></description><category></category></item><item><title><![CDATA[LeetCode 1233 Remove Sub-Folders from the Filesystem (Trie)]]></title><link>https://blog.csdn.net/Tc_To_Top/article/details/123946396</link><guid>https://blog.csdn.net/Tc_To_Top/article/details/123946396</guid><author>Tc_To_Top</author><pubDate>Sun, 03 Apr 2022 22:52:28 +0800</pubDate><description><![CDATA[Given a list of foldersfolder, returnthe folders after removing allsub-foldersin those folders. You may return the answer inany order.

If afolder[i]is located within anotherfolder[j], it is called asub-folderof it.

The format of a path is one o...]]></description><category></category></item><item><title><![CDATA[LeetCode 990 Satisfiability of Equality Equations (并查集 推荐)]]></title><link>https://blog.csdn.net/Tc_To_Top/article/details/123614415</link><guid>https://blog.csdn.net/Tc_To_Top/article/details/123614415</guid><author>Tc_To_Top</author><pubDate>Sun, 20 Mar 2022 15:42:57 +0800</pubDate><description><![CDATA[You are given an array of stringsequationsthat represent relationships between variables where each stringequations[i]is of length4and takes one of two different forms:"xi==yi"or"xi!=yi".Here,xiandyiare lowercase letters (not necessarily diffe...]]></description><category></category></item><item><title><![CDATA[LeetCode 1975 Maximum Matrix Sum (贪心)]]></title><link>https://blog.csdn.net/Tc_To_Top/article/details/123611955</link><guid>https://blog.csdn.net/Tc_To_Top/article/details/123611955</guid><author>Tc_To_Top</author><pubDate>Sun, 20 Mar 2022 14:24:24 +0800</pubDate><description><![CDATA[You are given ann x nintegermatrix. You can do the following operationanynumber of times:

Choose any twoadjacentelements ofmatrixandmultiplyeach of them by-1.
Two elements are consideredadjacentif and only if they share aborder.

Your goal ...]]></description><category></category></item><item><title><![CDATA[LeetCode 1524 Number of Sub-arrays With Odd Sum （前缀和）]]></title><link>https://blog.csdn.net/Tc_To_Top/article/details/123596451</link><guid>https://blog.csdn.net/Tc_To_Top/article/details/123596451</guid><author>Tc_To_Top</author><pubDate>Sat, 19 Mar 2022 15:59:57 +0800</pubDate><description><![CDATA[Given an array of integersarr, returnthe number of subarrays with anoddsum.

Since the answer can be very large, return it modulo10^9+7.

Example 1:


Input: arr = [1,3,5]
Output: 4
Explanation: All subarrays are [[1],[1,3],[1,3,5],[3],[3,5],[5]]
All ...]]></description><category></category></item><item><title><![CDATA[LeetCode 688 Knight Probability in Chessboard (概率dp)]]></title><link>https://blog.csdn.net/Tc_To_Top/article/details/123590979</link><guid>https://blog.csdn.net/Tc_To_Top/article/details/123590979</guid><author>Tc_To_Top</author><pubDate>Sat, 19 Mar 2022 11:09:12 +0800</pubDate><description><![CDATA[On ann x nchessboard, a knight starts at the cell(row, column)and attempts to make exactlykmoves. The rows and columns are0-indexed, so the top-left cell is(0, 0), and the bottom-right cell is(n - 1, n - 1).

A chess knight has eight possible move...]]></description><category></category></item><item><title><![CDATA[LeetCode 1054 Distant Barcodes (排序 贪心)]]></title><link>https://blog.csdn.net/Tc_To_Top/article/details/123579347</link><guid>https://blog.csdn.net/Tc_To_Top/article/details/123579347</guid><author>Tc_To_Top</author><pubDate>Fri, 18 Mar 2022 16:55:07 +0800</pubDate><description><![CDATA[In a warehouse, there is a row of barcodes, where the ith barcode is barcodes[i].

Rearrange the barcodes so that no two adjacent barcodes are equal. You may return any answer, and it is guaranteed an answer exists.

Example 1:


Input: barcodes = [1,1,1,2]]></description><category></category></item></channel></rss>