Leetcode Daily Question
2.46K subscribers
517 files
2.16K links
Why are you asking me to do Leetcode for this CSS job?
Download Telegram
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 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 都由一系列缩写为 'A''C''G''T' 的核苷酸组成,例如:"ACGAATTCCG"。在研究 DNA 时,识别 DNA 中的重复序列有时会对研究非常有帮助。

编写一个函数来找出所有目标子串,目标子串的长度为 10,且在 DNA 字符串 s 中出现次数超过一次。

 

Example
输入:s = "AAAAACCCCCAAAAACCCCCCAAAAAGGGTTT"
输出:["AAAAACCCCC","CCCCCAAAAA"]
Leetcode-cn.com 2021-12-23
🔴 1044.longest-duplicate-substring

🏷️ Tags
#string #binary_search #suffix_array #sliding_window #hash_function #rolling_hash

Description
给你一个字符串 s ,考虑其所有 重复子串 :即,s 的连续子串,在 s 中出现 2 次或更多次。这些出现之间可能存在重叠。

返回 任意一个 可能具有最长长度的重复子串。如果 s 不含重复子串,那么答案为 ""

Example
输入:s = "banana"
输出:"ana"