You are given two integers L and R. Your task is to return the sum of all Fibonacci numbers that lie within the inclusive range [L, R].
The Fibonacci sequence starts with 0 and 1. Each subsequent number is calculated as the sum of the two preceding numbers. Include every Fibonacci number that falls between L and R, including both endpoints. If no Fibonacci number lies in the given range, return 0.
Input: L = 1, R = 10
Output: 20
Explanation: The Fibonacci numbers 1, 1, 2, 3, 5, 8 lie within the range. Their sum is 20.
Input: L = 5, R = 20
Output: 26
Explanation: The Fibonacci numbers 5, 8, and 13 lie within the range. Their sum is 26.
Input: L = 100, R = 120
Output: 0
Explanation: No Fibonacci number lies within the range, so the sum is 0.
Sign in to write, run, and submit your solution against the full test suite.