← 返回 doordash 的题目列表Longest Common Restaurant List
类型:online_judge
Given two delivery drivers' lists of restaurants to pick up, where each driver has a list of restaurants they want to pick up from. The two drivers share a single car, so they can only go to restaurants that both need to pick up from. Find the longest common list of restaurants, maintaining the restaurant order, for example, if they pick up at C, they cannot go back to A or B.
Example
Input
['A', 'B', 'C', 'D'] ['B', 'C', 'E']