Write code for the Fibonacci sequence in your preferred language and discuss time and space complexity.
Implement def fibonacci(n):, where n is a non-negative integer. Return a list containing the first n Fibonacci numbers, beginning with 0, 1; return an empty list when n is 0.
def fibonacci(n):