Pergunta de entrevista da empresa Google

Implement a function, F(int n) to calculate the nth Fibonacci number.