public static int fib(int n)
{
if (n < 3)
{
return 1;
}
int num1 = 1, num2 = 1;
for (int i = 3; i < n; i++)
{
int temp = num1 + num2;
Type: Posts; User: helloworld922
public static int fib(int n)
{
if (n < 3)
{
return 1;
}
int num1 = 1, num2 = 1;
for (int i = 3; i < n; i++)
{
int temp = num1 + num2;
Calculating Fibonacci can be fast... O(n) with O(1) memory space :)
It might be easier to work with the corners rather than the centers because they are always aligned by at least one axis (either...