leetcode
2657. Find the Prefix Common Array of Two Arrays
Solution
Python code
Java code
Time complexity: O(n)
Space complexity: O(n)