You are given an array of positive integers nums.
A Fibonacci subarray is a contiguous sequence of numbers where each element (starting from the third one) is the sum of the two preceding elements.
Your task is to find and return the length of the longest Fibonacci subarray in nums.
Note:
Subarrays of length 1 or 2 are always considered Fibonacci by default.
Input: nums = [2, 3, 5, 8, 13, 21, 4, 6]
Output: 6
Input: nums = [4, 5, 9, 14, 23, 37, 2]
Output: 6
Accepted:
Submission: