Given a 2D array of integers, this problem looks for the longest path of consecutive numbers that can be formed in the array. The path can start and end at any location in the array , and the example output given is 6.
The candidate's solution is correct and uses a DFS algorithm to find the longest path. The time complexity is O(n) where n is the number of elements in the array. The space complexity is O(n) where n is the number of elements in the array.
Evaluated at: 2022-11-23 04:16:15