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...
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. :)
For a years of wars i noticed the you are the only person who somehow reacted on my comments.
My solution is in C++ (Clang8 C++17).
I believe i can not publish it here. So looking for you in c++ branch.
And yes, i was much more lasy in this case.
Dear Hobovsky,
Seems as before you had read my comment a bit too literally.
Indeed you are right - my comment did not help the author to make the kata better. ( And for that i already stated it is useless and sorry for that )
Actually, if you were interested to identify the language of tests which pass or not pass you might simply pass the kata, and thereafter look at my only solution.
Start it couple of times or even cycle it for hundred times and get the conditions at which it would fail.
Unfortunately i just run my solution once, it pass all the tests, i executed it second time it fail some tests, i was not wondered what was the problem and run the submission for the third time and it pass all the tests again.
So we know that random test cases coud generate failing tests. Either because some error in authors own solution or in mine. Mine was performed without due care, thus i assume that there is error in it and thus i think that test cases does not cover the solution effectively.
I believe simple two colums 1000 rows 'moshpit' scene which will end op with ' ','xx',' ' would trigger failure for my solution. But i believe it is not what triger referred error on my submission.
I.e. i was as laysy as youself and did not performed search by myself, but stated, that isssue exists. And might be someone more motivated would find it out. Otherwise if i knew the answers on your questions i would definitely propose what test must be included...
Loading more items...