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.
How did this get any votes for best practices? You're wrapping this in a try except block because passing an integer to the list constructor raises a TypeError. There's no reason to handle exceptions for this kata.
This comment is hidden because it contains spoiler information about the solution
This is what I did too. I think a while loop works better for this kata than calling range()
I think the assumption is only broken pipes would be passed to the function.
This is way better than using a for loop.
MDN recommends using a reduce function instead.To paraphrase: spread (...) will either fail or return the wrong result if the array has too many elements, because they try to pass the array elements as function parameters. The reduce solution does not have this problem.