
[LeetCode] 873. Length of Longest Fibonacci Subsequence (Python)
·
알고리즘/LeetCode
난이도: MediumProblem DescriptionA sequence x1, x2, ..., xn is Fibonacci-like if:n >= 3xi + xi+1 == xi+2 for all i + 2 Given a strictly increasing array arr of positive integers forming a sequence, return the length of the longest Fibonacci-like subsequence of arr. If one does not exist, return 0. A subsequence is derived from another sequence arr by deleting any number of elements (including none)..