Browse and solve 1,200+ machine learning coding challenges on Deep-ML. Filter by difficulty (beginner, intermediate, advanced) and category (linear algebra, machine learning, deep learning, NLP, computer vision). Write Python solutions in the browser and get instant feedback against test cases.
Given a non-negative integer n, return a list containing the first n Fibonacci numbers. The Fibonacci sequence starts with 0 and 1, and each subsequent number is the sum of the two preceding ones. If n is 0, return an empty list.
n = 5
[0, 1, 1, 2, 3]
The first five Fibonacci numbers are generated by starting with 0 and 1, then adding the two previous numbers to get each next value: 0, 1, 0+1=1, 1+1=2, 1+2=3.