[LeetCode] 4. Median of Two Sorted Arrays_Hard tag: ArraySubarray Best Time to BUy and Sale Stock I, II, III- Prefix Sum[LeetCode] 560.Subarray Sum Equals K_Medium tag: Array, Subarray, prefix SumTwo pointers [LeetCode] 15. 3Sum_Medium tag: Array[LeetCode] 167. Two Sum II - Inp...
Given two string arraysword1andword2, returntrueif the two arrays represent the same string, andfalseotherwise. A string is represented by an array if the array elements concatenated in order forms the string. Example 1: Input: word1 = ["ab", "c"], word2 = ["a", "bc"] Output: t...
https://leetcode.cn/problems/check-if-an-original-string-exists-given-two-encoded-strings/ 字符串压缩码由于长度大于9时截断会出错,这道题正确的状态定义是s1的前i个字符,s2取前j个字符,同时有一个字符没匹配上的字符数量是k(可以用k的正负性表示是哪边没匹配上),附加维度不可删除。状态转移的细节也相当...
Leetcode 1110 Delete Nodes And Return Forest (分治) 二叉搜索树(BST):BST特征:中序遍历为单调递增的二叉树,换句话说,根节点的值比左子树任意节点值都大,比右子树任意节点值都小,增删查改均为O(h)复杂度,h为树的高度;注意不是所有的BST题目都需要递归,有的题目只需要while循环即可 Leetcode 230 Kth Sma...
leetcode 350. Intersection of Two Arrays II#52 leetcode 242. Valid Anagram#7 leetcode 202. Happy Number#8 leetcode 290. Word Pattern#53 leetcode 205. Isomorphic Strings#54 leetcode 451. Sort Characters By Frequency#55 leetcode 454. 4Sum II#13 ...
you are given an integer n, a 0-indexed string array words, and a 0-indexed array groups, both arrays having length n. The hamming distance between two strings of equal length is the number of positions at which the corresponding characters are different. You need to select the longest sub...
Median of Two Sorted Arrays 5 3 array Binary Search 5 Longest Palindromic Substring 4 2 string 6 ZigZag Conversion 3 1 string 7 Reverse Integer 2 3 Math 8 String to Integer (atoi) 2 5 string Math 9 Palindrome Number 2 2 Math 10 Regular Expression Matching 5 3 string Recursion DP 11 Co...
encrypt-and-decrypt-strings equal-row-and-column-pairs equal-sum-arrays-with-minimum-number-of-operations er-cha-shu-de-jing-xiang-lcof er-cha-shu-de-shen-du-lcof er-cha-shu-de-zui-jin-gong-gong-zu-xian-lcof er-cha-shu-ran-se-UGC er-cha-shu-ren-wu-diao-du er-cha-sh...
【题目】Given two sorted integer arrays A and B, merge B into A as one sorted array. Note: You may assume that A has enough space (size that is greater or equal to m + n) to hold additional elements from B. The number of elements initialized in A and B are m andn respectively....
2930.Number-of-Strings-Which-Can-Be-Rearranged-to-Contain-Substring (H-) 2954.Count-the-Number-of-Infection-Sequences (H) 3395.Subsequences-with-a-Unique-Middle-Mode-I (H) 3405.Count-the-Number-of-Arrays-with-K-Matching-Adjacent-Elements (H-) 3428.Maximum-and-Minimum-Sums-of-at-Most-Si...