fizzList
In this problem, you're practicing creating a list and adding specific elements to it that are generated using a loop. (Combining your knowledge of iteration and lists)
Given a number n, create and return a new int list of length n, containing the numbers 0, 1, 2, ... n-1. The given n may be 0, in which case just returns a length 0 array. You do not need a separate if-statement for the length-0 case; the for-loop should naturally execute 0 times in that case, so it just works.
fizzList(4) ->[0, 1, 2, 3]
fizzList(1) ->[0]
fizzList(10) ->[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
The following are methods of a list that can be used to manipulate the contained data.
Type your solution
Skills Practiced:
3.C
3.D
4.A
4.B
Saved
Saved