DEV Community 👩‍💻👨‍💻

Amr Elmoogy
Amr Elmoogy

Posted on

Help me to figure out pattern

Hi, I have an array of Fibonacci numbers up to (10 power 6) and a lot of Queries that ranges from L to R, these ranges are not indices but Fibonacci number, I wanna calculate number of even and odd numbers in these range, Is there a fast method to get this instead of take a loop from beginning range to end in these whole queries ?

Example :
2
2 21
3 13

Top comments (0)

🌚 Life is too short to browse without dark mode