Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
@brendanvos
Your own solution also mutates the original list passed trough the function.
Out of curiousity i tried your solution in Pycharm. I stored [1, 1, 1] in a variable x, stored 10 in varuable y, called the function with (x, y) parameters and after requested a print(x). Both the print(function) and print(x) yielded the same result.
Sorry if I'm mistaken, but aren't you also mutating the input (signature) in your solution?
When I apply this solution as tribonacci([15, 16, 14], 3) I receive [15, 16, 14] but I had in one of the randomly generated tests, that the correct answer should be [45], which does not make sense. There should be a clearer specification to what the function should do for n in [1,2,3], I guess.
You don't remember correctly. Python lists are mutable. Mutable objects are pass by reference.
If you make changes to a list which was passed in as a parameter you WILL mutate the list for the caller.
No because python should be treating anything within a function as abstracted. If I remember correctly you'd have to declare it as a global variable
good point.
You're mutating the signature despite that not being the goal of the function!
That's a no no!