题解 | #判断斐波那契数组#
判断斐波那契数组
https://www.nowcoder.com/practice/9df2a366eb25495caff41612bd0ffca6
const _isFibonacci = array => {
// 补全代码
if(array.length < 3) {
return false
}
let n = 2
while(n < array.length) {
if(array[n] = array[n-1] + array[n - 2]) {
return true
}
else {
n ++
}
}
}