Leetcode.com 2021-07-08
🟡 718.maximum-length-of-repeated-subarray
🏷️ Tags
#array #binary_search #dynamic_programming #sliding_window #hash_function #rolling_hash
Description
Given two integer arrays
Example
🟡 718.maximum-length-of-repeated-subarray
🏷️ Tags
#array #binary_search #dynamic_programming #sliding_window #hash_function #rolling_hash
Description
Given two integer arrays
nums1 and nums2, return the maximum length of a subarray that appears in both arrays.Example
Input: nums1 = [1,2,3,2,1], nums2 = [3,2,1,4,7]
Output: 3
Explanation: The repeated subarray with maximum length is [3,2,1].
Leetcode-cn.com 2021-10-08
🟡 187.repeated-dna-sequences
🏷️ Tags
#bit_manipulation #hash_table #string #sliding_window #hash_function #rolling_hash
Description
所有 DNA 都由一系列缩写为
编写一个函数来找出所有目标子串,目标子串的长度为 10,且在 DNA 字符串
Example
🟡 187.repeated-dna-sequences
🏷️ Tags
#bit_manipulation #hash_table #string #sliding_window #hash_function #rolling_hash
Description
所有 DNA 都由一系列缩写为
'A','C','G' 和 'T' 的核苷酸组成,例如:"ACGAATTCCG"。在研究 DNA 时,识别 DNA 中的重复序列有时会对研究非常有帮助。编写一个函数来找出所有目标子串,目标子串的长度为 10,且在 DNA 字符串
s 中出现次数超过一次。Example
输入:s = "AAAAACCCCCAAAAACCCCCCAAAAAGGGTTT"
输出:["AAAAACCCCC","CCCCCAAAAA"]