Description
Solutions
Closest Land Mark π
πRELATED PROBLEMS
Imagine you're on a journey along the path of numbers, starting from your current location marked by an integer N. Your goal is to find the nearest landmark, which happens to be a Fibonacci number. But before you can reach it, you must determine the distance you need to travel to get there. Your task is to calculate this distance and return it as another integer.
Function Description
Complete the function closestLandMark
in the editor π.
closestLandMark
has the following parameter:
int aNum
: an integer number
Returns
int
: the distance to the closest "land mark".
Memo: For original prompt, pls refer to source image π
Example 1:
Input: aNum = 25
Output: 4
Explanation:No explanation provided for now. Will add once find it :)
Example 2:
Input: aNum = 5
Output: 0
Explanation:No explanation provided for now. Will add once find it :)
Constraints:
0 β€ N β€ 1,000,000

Related Problems
Testcase
Result
Case 1
input:
output: