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.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
No, string literals are not allocated on the stack.
How is this respecting the "The returned string should be statically allocated and it won't be freed" requirement? The "true" and "false" here are declared on the stack on the function call, not on the heap and it will BE considered freed and eventually overwritten by some other process using the heap later down the road.
Although it "works" on the surface, returning strings like that will evenatually crash your programs.
can someone explain this
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This is really cool. New to Kotlin and excited to get to a level where I write one line functions like this.