Ad
  • Custom User Avatar
  • Custom User Avatar

    Sorry I accidentally flagged the above comment because it is hidden and I thought I was expanding it to see what it said.

  • Custom User Avatar

    OK, so I solved it (passed all the random tests - yay!).

    But then I attempted the exact same solution again and... I fail around the 30-40th random test.

    :(

    I ran my function on my local IDE and I was getting the same answer as in codewars. Not the answer it was saying I was getting. Strange.

  • Custom User Avatar

    I have passed all the test cases up until "Random Tests". I am working in Python 3.

    print de_nico("mguqh", "ahovcxmxanhchozghcimjp ilxgnsclz o") should equal 'oacvhxxnamhhzoccgmih jlipnxcsg loz', but I get "oacvhxxnamhhzoccgmih jlipnxcsg l oz" with my function.

    print de_nico("wemuto", "vhdanjrptrrugjan"), should equal "jvhnadurprrtgjna", but I get "jvhnadurprrt gj na" with my function

    print de_nico("uyt", "pmoemabhvgdjw") should equal "mopmaehvbdjgw", but I get "mopmaehvbdjg w" with my function.

    Once you have decrypted the key, it seems to me that the way to modify spaces, i.e. ' ', at the beginning of each row, into the output, is not well-defined.

    To clarify further, I have tried (after decrypting the key):

    1. removing all spaces ' ' so that no spaces are left in the output.
    2. removing only the spaces ' ' at the end of the final row, but keeping all other spaces in the output. I believe this is what is meant by removing "trailing whitespace".
    3. removing the spaces at the beginning of every row if there are any, but keeping the spaces at the end of each row, in the output.

    But none of these pass the "random tests".

    Thanks for help in advance