Search
⌘K
Get Premium
Leetcode 873. Length of Longest Fibonacci Subsequence
Given a strictly increasing array of positive integers, find the length of the longest subsequence (not necessarily contiguous) that is Fibonacci-like — i.e., every element from the third equals the sum of the two preceding ones — or return 0 if none exists. Constraints: 3 ≤ n ≤ 1000 and values ≤ 1e9, so solutions typically exploit pairwise relationships (DP/hash) to build lengths efficiently.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.