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.
My code works for both, so I see no harm in accounting for more cases.
the instructions explicitly state that it will only be 1 digit.
This was my initial thought, but I tried to account for ages more than just 1 digit.
This comment is hidden because it contains spoiler information about the solution
Because the reply is coming as a string, and the condition is that first character is always a number. Thus you want only the first character exported from the given string.
could you explain why you use [0]?
nice! I solved it differently and it's interesting how you solve it
Yeah, but the description clearly says "first character will be the desired answer" so while your approach is more correct (or best practice) and solves wider problem, the task itself was much simpler in this case.
nice job
I also solved it.
This comment is hidden because it contains spoiler information about the solution
I have The same input. But this will not work on other type of strings like "i am 7 years".
This comment is hidden because it contains spoiler information about the solution
spoiler flag! x/
I'd change the
>=
to just>
There's no point in replacing the result if id doesn't actually change, right?
Loading more items...