NeetCode #718LC-873Medium2-D Dynamic Programming
← Back to All Problems#718 · #873 · Length of Longest Fibonacci Subsequence(最长的斐波那契子序列的长度)
📌 Problem Statement & Constraints
Given a strictly increasing array
arr of positive integers, return the length of the longest Fibonacci-like subsequence, in which each term equals the sum of the two preceding terms. Return 0 if no such subsequence of length at least 3 exists. Constraints: 3 <= arr.length <= 1000, 1 <= arr[i] < 2^31.🔒
Sign In to Unlock Full Solutions for All 973 Problems
Sign in to access step-by-step logic, benchmark Python3 code, complexity breakdown, and offline export!