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.
Very idiomatic... I like it!
The code is short, very slick, but all those strings!
That's very nice... I did the same logic but missed the application of fold, which is elegant.
A very elegant solution if I may say so, distinguishing the square that may arise in processing from a square supplied as initall argument.
In Rust, types str and String are Unicode strings, with varialbe sized chars, so you can't index into them or easily determine their length in chars or graphemes. The len() method is the length in bytes. The only way to reliably process a Unicode string is to iterate from the start. All the solutions to this in Rust which make use of len() are vulnerable to Unicode strings with multibyte chars.
Several upticks for 'Best Practices' which I don't understand. This is exactly a C/C++ solution transscribed into Rust, it works but is not idiomatic Rust. I'd therefore say NOT best practice.