Sum of the First K Fibonacci Numbers — Solution & Editorial
Either accumulate directly or use the telescoping identity ∑Fi = FK+2 − 2.
Complexity: O(K) or O(1) with the identity
Either accumulate directly or use the telescoping identity ∑Fi = FK+2 − 2.
Complexity: O(K) or O(1) with the identity