package
Version:
v1.4.9
Opens a new window with list of versions in this module.
Published: Nov 15, 2019
License: MIT
Opens a new window with license information.
Imports: 0
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
< Previous
Next >
Given two integer arrays A
and B
, return the maximum length of an subarray that appears in both arrays.
Example 1:
Input:
A: [1,2,3,2,1]
B: [3,2,1,4,7]
Output: 3
Explanation:
The repeated subarray with maximum length is [3, 2, 1].
Note:
- 1 <= len(A), len(B) <= 1000
- 0 <= A[i], B[i] < 100
[Array]
[Hash Table]
[Binary Search]
[Dynamic Programming]
Similar Questions
- Minimum Size Subarray Sum (Medium)
Hints
Hint 1
Use dynamic programming. dp[i][j] will be the answer for inputs A[i:], B[j:].
Documentation
¶
There is no documentation for this package.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.