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.
spoiler flag...
This comment is hidden because it contains spoiler information about the solution
Just thinking that "loop the same long string 26 times" already is O(n).
unnecessary variable
с
Bc the office value always needs to be incremented and should therefore not be included in the conditional code.
the home value is only reduced if an umbrella already was waiting there to be taken with.
Yes, totally.
We can do in O(n) if we first count the string chars and later do the check.
Is someone able to explain why this works if you don't use curly brackets on the if (home) and (office) statement but works if you leave them out?
eg:
if (home) {
home--
office++
}