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.
The test cases just never set arr to None, that's why there's no error. What they do though is setting arr to [], which is different than None.
But in general you're right. One should check if arr is None before iterating over it.
I guess Acmer77 means that the variable name
sum
should be avoided because its name is too similar to the function namedsum()
.Hey! Just finished translating this Kata to Rust. Can anyone please review it at Exes and Ohs in Rust?