Skip to content

Instantly share code, notes, and snippets.

@jasongorman
Last active December 15, 2015 10:26
Show Gist options
  • Select an option

  • Save jasongorman/e797575197e809a95fd1 to your computer and use it in GitHub Desktop.

Select an option

Save jasongorman/e797575197e809a95fd1 to your computer and use it in GitHub Desktop.
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