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.
For your solution, I missed the iterator part in map. yes, the space complexity will be O(1) but then it is a slower iteration over sequence. a simple loop should be faster. Mind me I understand that they both are O(n) time complexity but simple loop should be a faster O(n) out of those two. let me know what you think.
This comment is hidden because it contains spoiler information about the solution
i think counter method is more efficient space wise. however , it has same time complexity
added two instance of add![x, y]
I can see the problem now but i am afraid i have no ideas of how to stop this problem. Please suggest me if we have standard way of avoiding this problem in codewars.
Thanks in advance.
Added two test cases without values in error messages
Thanks for pointing that out. I have just added a Example test case for clarification.
This comment is hidden because it contains spoiler information about the solution
strcmp leaves 0 if strings are same.
ternery operator is expecting nonzero for true eg. (condition)? true: false
That's why !strncmp()
Hey, please fix the expected output in instruction. it is confusing.
["Stefan", "Raj", "Marie", "Amy", "Edward", "Alexa", "Juan", "Liz", "Claire", "Katie", "Dee", "Luke"]
it should be
["Stefan","Raj","Marie","Edward","Amy","Alexa","Liz","Claire","Juan","Elle","Luke","Dee"]