3708. Longest Fibonacci Subarray
You are given an array of positive integers
nums.A Fibonacci array is a contiguous sequence whose third and subsequent terms each equal the sum of the two preceding terms.
Return the length of the longest Fibonacci subarray in
nums.Note: Subarrays of length 1 or 2 are always Fibonacci.
1 | class Solution { |