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.
Had a similar approach, but used some built-in functions to make life a little easier.
The instructions are as follows.
"Take 2 strings s1 and s2 including only letters from a to z. Return a new sorted string, the longest possible, containing distinct letters - each taken only once - coming from s1 or s2."
A non-latin alphabet isn't specified in the instructions and wouldn't be included in this use case.
Nice feedback!
As a beginner, I always write a numbers of lines, test the result by "print" and only if all works - do "pythonization" :) trying to get a single line code
This comment is hidden because it contains spoiler information about the solution
i like this one nice logic rather than using builtin functions and methods always.. great solutioin
Simple but viable.
Yeah, I just do it to get exp for kyu rank 3 years ago, so I speed run the code lol
You literally did the same thing as the top solution though lol
The C programmer in me likes this.
What a great tip! Thanks man!
I think he means that instead of typing the alphabet yourself as a variable, use the already builtin one to avoid unnecessary errors ( which lead to bad code). I think!
I'm sorry but what is a magic number, and why are strings the experts of bad codes?
This wouldn't work if the strings use a non latin alphabet.
Nice commented code, as a team leader, I will prefer this kind of code better than the one liner code above. Eventhough the algorithm is not so good, but it's clear. Those code above is only for solo project, or scripting due to thier quickness. Please keep your habbit, and good luck learning.
Thanks for the hint!
Loading more items...