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.
Dear Sir's Would be nice to add a small hint that strings shall be sorted based on ACII character values.
ie using StringComparer.Ordinal comparator. Seems default for C# comparator using different logic.
Dear Smileous,
The logic of your algorithm is quite right, it would generally work absolutely the same way as kanonical BWT, the difference is in the fact that canonical BWT should be expected to work not with letters of text, but with bytes and their values where character 'a' and 'A' are quite different letters having different ACII code values, while your algorithm implement some default C# comparison method with specific comparison logic.
In order for you to fix your code you shall try to adjust default for C# sort order and to ensure that texts are sorted based on ACII codes of relevant characters.
I assume that remark regarding sort order would be useful in KATA Description, but it is absolutely not mandatory, and would be not fare to consider it to be KATA issue.
I would write here reply on your old question, just to make a note on my understanding of join statement work.
Databases are usually working with various data having certain characteristics based on which data could be filtered or sorted.
If you have two independent sets of data you have to allign certain elements from one set with certain elements from another set.
I.e. you do something like: for each element from set 1 find elements in set 2.
In your particular case your request is: For each element in table posts find 2 elements in table categories where id's are equal.
we took first post, take it category and search for it in table categories, obviouisly your limit statement does not make any sence as soon as for each element form posts table always exists only one record in categories ...
I wander if my solution would work at (3,-2) and if no, that would mean test envioronment does not have sufficient coverage.
Would be nice for a long test to provide some estimation of %% completion.
'''if(i%(BIG_SIZE/10)==0) printf("%2.0f of the Addition test passed\n",(double)i/BIG_SIZE);'''
That would give some clue if the solution is on the right track and need only cosmetical enhancments.
The logic behind the calculations of poker haands is straight forward.
The whole difficulty of the kata is absence of clear defenition of the requirements...
What i would suggest is to rephrase text above in better english and add it to description instead or together with wikipedia refference.
In fact you dont need, but the problem states:
QT
UNQT
So in description should be clarified:
With these 36 digits it is theoretically possible to encode numbers up to 36!-1, but for the purposes of this kata in C version numbers would be always less then
ULLONG_MAX
OR
So we extend 0..9 with letters A..J. With these 20 digits we can now...
Do you really need to calculate factorial of numbers > 20! ?
In C in the envioroment of codewars server unsigned long long does not support numbers > 20!.
So, in this kata C version would be good to state that in description.
or
change input and output parameters of the functions from unsigned long long to const char*, but in such case complexity of the kata would increase.
according to the Kata 4041000 is 4*(6!)+4*(4!)+3! == 2982
The index is counted from zero upward.
This comment is hidden because it contains spoiler information about the solution
Divide et impera
Finally i found deficiency of my code.
the empty spaces surrounded by moshpit was not always marked as part of moshpit.
The following group of tests could filter it out:
Wow, discussion. :)
"hob has to learn C++" is a secondary matter. in the first place, i have to know it's C++ because if I don't know this, which language should I learn? :D
Loading more items...