Last active
December 15, 2015 10:26
-
-
Save jasongorman/e797575197e809a95fd1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class Fibonacci | |
| { | |
| public int[] GenerateFibonacciSequenceWithLength(int length) | |
| { | |
| int[] sequence = new int[length]; | |
| for (int i = 0; i < sequence.Length; i++) | |
| { | |
| sequence[i] = i < 2 ? i : sequence[i - 1] + sequence[i - 2]; | |
| } | |
| return sequence; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment