Fibonacci Checker
Function Name: isFibonacciNumber
Description
Write a function named `isFibonacciNumber` that determines if a given non-negative integer number is a Fibonacci number. The Fibonacci sequence is a series of numbers where each number is the sum of the two preceding ones, usually starting with 0 and 1. That is, fib(0) = 0, fib(1) = 1, fib(2) = 1, fib(3) = 2, fib(4) = 3, fib(5) = 5, fib(6) = 8, and so on.
Your function should take one integer parameter and return a boolean value indicating whether the number is part of the Fibonacci sequence.
Requirements
- The function must take exactly one parameter: a non-negative integer.
- If the input number is a Fibonacci number, the function should return true; otherwise, it should return false.
- The solution should run efficiently and handle large input values with reasonable performance.
- Do not use recursion to solve this problem; an iterative or mathematical approach is expected.
Examples
If the input number is 8, the function should return true because 8 is a Fibonacci number (0, 1, 1, 2, 3, 5, 8).If the input number is 20, the function should return false because 20 is not a Fibonacci number.
Links
Garden Watering Scheduler
Fri Aug 30 2024
Write a function to to help schedule garden watering times throughout a given week.The garden requires watering every other day, starting on Monday, at the same time each scheduled day.You should output a schedule that lists the day of the week and the corresponding time for watering.The function must take two parameters: the start time for watering on the first day (a string in 'HH:MM' 24-hour format), and a positive integer representing the number of weeks to schedule.
Anagram Detector
Sun Sep 01 2024
An anagram is a word or phrase formed by rearranging the letters of a different word or phrase, typically using all the original letters exactly once. For example, the word 'listen' is an anagram of 'silent'.Your task is to write a function 'areAnagrams' that takes two strings as parameters and returns a Boolean value. The function should determine whether the two strings are anagrams of each other, considering letter case and ignoring whitespace and punctuation.