1923. Longest Common Subpath
Description
**Input:** n = 5, paths = [[0,1,2,3,4],
[2,3,4],
[4,0,1,2,3]]
**Output:** 2
**Explanation:** The longest common subpath is [2,3].**Input:** n = 3, paths = [[0],[1],[2]]
**Output:** 0
**Explanation:** There is no common subpath shared by the three paths.**Input:** n = 5, paths = [[0,1,2,3,4],
[4,3,2,1,0]]
**Output:** 1
**Explanation:** The possible longest common subpaths are [0], [1], [2], [3], and [4]. All have a length of 1.ac
Last updated