The Fibonacci sequence is a series of numbers in which each number is the sum of the two preceding ones, usually starting with 0 and 1. The sequence starts with 0 and 1, and then each number is the sum of the two preceding ones.

You are given a function fibonacci(n: u32) -> u32 that takes a number n and returns the n-th number in the Fibonacci sequence.

Your job is to implement the function meeting the following requirements:

If given n is 0, the function should return 0.

If given n is 1, the function should return 1.

If given n is greater than 1, the function should return the sum of the two preceding numbers.

Here are some examples of how the behavior of the function should look like:

Editor not available on Mobile!

In order to solve the challenge, please visit this page on a desktop computer.

Fibonacci

The Fibonacci sequence is a series of numbers in which each number is the sum of the two preceding ones, usually starting with 0 and 1. The sequence starts with 0 and 1, and then each number is the sum of the two preceding ones.

You are given a function fibonacci(n: u32) -> u32 that takes a number n and returns the n-th number in the Fibonacci sequence.

Your job is to implement the function meeting the following requirements:

If given n is 0, the function should return 0.

If given n is 1, the function should return 1.

If given n is greater than 1, the function should return the sum of the two preceding numbers.