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.
eb110 - AABA is a different set of letters with a different set of permutations than ABAB.
I solved the kata by comparing costs.
If you insert a letter, it implies that you have to delete and add a certain letter: (cost 2)
If you simply add or delete: (cost 1)
This is a well known approach called minimum edit distance.
I passed all tests but the one we are talking about.
rkacypviuburk to zqdrhpviqslik, cost: 16 because you have to delete and add 8 letters
rkacypviuburk to karpscdigdvucfr, cost: 12 because you have to delete and insert 5 and also delete 2 letters
Please correct me if I'm wrong!
I thought you have to "use" all letters - so AABA is missing one "B" letter. Or perhaps my logic if wrong.
It seems words with similar length are preferred. zqdrhpviqslik is the same length as rkacypviuburk.
I agree with you, karpscdigdvucfr is more similar, but it's just not what this kata wants:
TERM | WORD | MATCHING PATTERN | SCORE
rkacypviuburk | zqdrhpviqslik | ---r-pvi----k | -3
rkacypviuburk | karpscdigdvucfr | karp-c-i--vu--r | 3
have a question
of the tests is failing to me
is expecting 'zqdrhpviqslik', but I found 'karpscdigdvucfr', the word is "rkacypviuburk",
but I cannot understand why my solution is wrong. I think "karpscdigdvucfr" is more similar to "rkacypviuburk".
What am I missing ?
what I get is this
supose you receive 'AAAB', then all posibilities are (always based on the letters)
AAAB = 1
AABA = 2
ABAA = 3
BAAA = 4
if you get 'ABAB', all posibilities are (if I don't miss anything)
AABB = 1
ABAB = 2
ABBA = 3
BAAB = 4
BABA = 5
BBAA = 6
and the task is to return the correct index
actually, i can't understand well this kata, so confused
2 too.
Hey guys, I have a question,
the sample says ABAB = 2, but then how much should AABA return ?
oh, I get it, thanks for the tip
Write
System.out.println(n);
inside your function.this is what I get from the test, not sure what the input value is
Why don't you simply print the input value?
I get this in the random tests
expected:<[6[8902203007853440, 0, 2]]> but was:<[6[9022030078534408, 0, 17]]>
is there a way to know the original number based on the expected value ?
If I understood properly, the original number is 96802203007853440, but isn't in that case the smallest number 9680220300785344 ?