You are given a non-negative integer n. Your task is to determine whether the given number belongs to the Fibonacci sequence.
The Fibonacci sequence starts with 0 and 1. Each subsequent number is calculated as the sum of the two preceding numbers. Return True if n appears in the sequence; otherwise, return False.
Input: n = 21
Output: True
Explanation: 21 appears in the Fibonacci sequence, so the output is True.
Input: n = 22
Output: False
Explanation: 22 does not appear in the Fibonacci sequence, so the output is False.
Input: n = 0
Output: True
Explanation: 0 is the first number in the Fibonacci sequence, so the output is True.
Sign in to write, run, and submit your solution against the full test suite.