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.
A testcase could be n = 4000, m = 4000, which will evaluate to -96 in i16
This comment is hidden because it contains spoiler information about the solution
You should have the factors in the first array, and the number of each in the second
So one 2 and one 5 are written as an array containin the 2 and 5, and a second array containing the number of them; one of each
so it's [[2,5],[1,1]]
Make sure when doing your decode that your key is using the "decoded" text and not the encoded text, meaning you can't pre-compute the key on decode.
From the description:
With the basic Vigenère Cipher, we assume the key is repeated for the length of the text, character by character. In this kata, the key is only used once, and then replaced by the decoded text
For some reason the random tests require the anser to be -1. As you can see, I was forced to either wait for the bug to be fixed, forfeit this kata or cheat the bug.
Same here:
Wrong result for recipe
{'butter': 73, 'crumbles': 54, 'chocolate': 91}
and available ingredients
{'butter': 9326, 'crumbles': 3929, 'chocolate': 1394} #unrequired ingredients removed te declutter
: 15 should equal -1
Clever! How you use binary mapping of the three cells to make a single condition check.
You could have used a defaultdict instead of the getPriority function.
That test case is right. It's actually there to make it easier to conceptualize how the polyalphabetic shifts work in this particular Vigenere variant.
I said it should NOT result in PASSWORDPASSWORDPASSWORD. This is one of the default test cases, but I can't see how that testcase could be right.
AAAAAAAAPASSWORDAAAAAAAA with the key "PASSWORD" and a standard uppercase latin alphabet should indeed result in an encoded string of PASSWORDPASSWORDPASSWORD, so it seems like you're misunderstanding the definition. Also, the test cases don't refer to any variable called key, so I'm guessing that's on your end.
This comment is hidden because it contains spoiler information about the solution
A missing first or last element is not a sequence with a single element missing.
[2,3,4,5,6] is a correct sequence, it is not correct to state it should be [1,2,3,4,5,6] or [2,3,4,5,6,7]