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.
IMO, production coding is not hack-competition like CodeWars.
Therefore such signature refactoring is actually welcome and recommended if appropriate.
Please note that all character offsets are in UTF-8 Code Units, not Grapheme Cluster offset as specified in code comment.
Fixed!
Fixed!
I'm working on it. Thanks.
Is this something called compile-time execution? :P
This comment is hidden because it contains spoiler information about the solution
You need to change return type to
usize
.IMO, the problem is in the question. The question does not define "length" precisely.
We have several kind of lengths in a Unicode string such as Code Unit count, Scalar Value count, Grapheme Cluster count, byte count.
This answer is perfectly fine if the question was intended for byte count or Code Unit count.
It sould be nicer if type name
Cons
was different with its first member variantConst::Cons
...How should
[
and]
work? Manual is unclear and there's no sample.What should I do for negative coordinates?
What's exit code 132?