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.
I tried making a language-agnostic description. It would only need to add a comment in solution setup to precise the type of
greek_alphabet
. It shouldn't be too difficult as there is currently one approved language.Description
Write a comparator for a list of phonetic words for the letters of the greek alphabet.A comparator is:
(source: https://docs.python.org/2/library/functions.html#sorted)
The greek alphabet is preloaded for you as
greek_alphabet
. Its type (e.g., tuple, list, table, etc.) depends on your language and is specified in a comment within the solution setup:Examples
code to copy/paste
Write a comparator for a list of phonetic words for the letters of the [greek alphabet](https://en.wikipedia.org/wiki/Greek_alphabet).A comparator is:
> *a custom comparison function of two arguments (iterable elements) which should return a negative, zero or positive number depending on whether the first argument is considered smaller than, equal to, or larger than the second argument*
*(source: https://docs.python.org/2/library/functions.html#sorted)*
The greek alphabet is preloaded for you as `greek_alphabet`. Its type (e.g., tuple, list, table, etc.) depends on your language and is specified in a comment within the solution setup:
```
greek_alphabet = [
"alpha", "beta", "gamma", "delta", "epsilon", "zeta",
"eta", "theta", "iota", "kappa", "lambda", "mu",
"nu", "xi", "omicron", "pi", "rho", "sigma",
"tau", "upsilon", "phi", "chi", "psi", "omega"
]
```
## Examples
```
Inputs: "alpha", "beta"
Ouput: a negative number
Inputs: "psi", "psi"
Ouput: 0
Inputs: "upsilon", "rho"
Output: a positive number
```
Lua translation !
this is missing context which is in the original source text but is not applicable here. it should be removed.
Duplicate.
Needs random tests.
The kata setup really needs to be rewritten. For starters, everything in user code should be wrapped in a class. Currently variables are operated in global scope ;-(
This test makes no sense:
If the node has no child then it's a leave, even if it's a root node.