Choose a subsequence of the strictly increasing positive integer array arr, keeping the original order. It is Fibonacci-like if it contains at least three values and every value from the third onward equals the sum of the two preceding chosen values. Return the greatest possible length of such a subsequence, or 0 if none exists.
Example 1:
Input: arr = [2,3,5,8,13]
Output: 5Explanation: The entire array is Fibonacci-like: 2 + 3 = 5, 3 + 5 = 8, and 5 + 8 = 13. Its length is 5.
Example 2:
Input: arr = [1,4,10]
Output: 0Explanation: The only three-value subsequence is [1,4,10], and 1 + 4 does not equal 10. Therefore no qualifying subsequence exists.
Example 3:
Input: arr = [1,2,3,5,9,14]
Output: 4Explanation: The subsequence [1,2,3,5] has length 4 and is Fibonacci-like. No longer qualifying subsequence can be formed.
Constraints:
3 <= arr.length <= 10001 <= arr[i] <= 1000000000- The array is strictly increasing.