Problem 873 · Medium

Length of Longest Fibonacci Subsequence

DP over ending pairs (j, k): extend the Fibonacci chain whose previous element is arr[k] - arr[j].

Open the interactive visualisation