Ad
  • Custom User Avatar

    Approved by someone

  • Default User Avatar

    This solution works only if in input String every opening parenthesis has a pair - closing parenthesis. If it's not, you receive stackoverflow error.

  • Default User Avatar

    This works very well to solve the challenge, but on the IDE (IntelliJ) occurs an exception > .PatternSyntaxException: Stack overflow during pattern compilation.
    Could someone explain to me? Ty

  • Custom User Avatar

    Java translation published above by someone

  • Custom User Avatar

    Probably it takes too much time (Stackoverflowerror) to reach a solution. Because in the random tests you can obtain a string of more than 5 letters inside the input (a lot of permutations to check).

  • Custom User Avatar

    Similarly:

    st = eZ]S;pL"y?/ffzF)NWN#i7l7lN#i)YE?F)NW?/bE>w]S;"u4&7l?/F)NW7l2thOD4"u4&wN)YE?q^Fr"y"ycED4bE>w/bdu")YE?!]$F)NWD4D4du"!]$ffz}l?/?/"y"u4&"u4&pLU!/bN#icE}lD4ffzcE"y}lF)NW)YE?fGz}l'AIwNbE>wpLeZdu"q^FrpLD4bE>w)YE?"ypL}lfGz}lca,q^FrbE>w]S;N#icEq^FreZ"u4&}lbGEbE>w"ycEeZca,du"F)NWfGzffzq^Fr
    
    encryption_dict = {'a': '!]$', 'b': 'fGz', 'c': 'ffz', 'd': '"u4&', 'e': '/b', 'f': "'AI", 'g': 'U!', 'h': 'F)NW', 'i': 'ca,', 'j': 'bGE', 'k': '7l', 'l': 'D4', 'm': 'wN', 'n': 'N#i', 'o': '"y', 'p': '2thO', 'q': 'bE>w', 'r': '}l', 's': ')YE?', 't': '?/', 'u': 'du"', 'v': 'q^Fr', 'w': 'eZ', 'x': 'pL', 'y': 'cE', 'z': ']S;'}
    
    'wzxotchnkknsh?eE>wzdkthkpldmsvooylqeusahlluacrttoddxgenyrlcyorhsbrfmqxwuvxlqsoxrbrivqznyvwdrjqoywiuhbcv'
    should equal
    'wzxotchnkknshtqzdkthkpldmsvooylqeusahlluacrttoddxgenyrlcyorhsbrfmqxwuvxlqsoxrbrivqznyvwdrjqoywiuhbcv'
    

    The description says there is only one solution for each encryption/decryption, which is violated in the random tests.

  • Custom User Avatar
    st = E&Is-/a]IR.mt{VN'L'L-/\`)OYe`jdN_'#M5VNza;Rtpa]-/-/IR.uhmt{C]9-/C]9\`)E&IstpA/@R'LE&IsVNE&Isk-dN_k-M#F`jVNmt{'Lmt{VN'LJ0_@C]9VNza;RJ0_@k-dN_tp-/A/@RIR.U*DJ'L-/uhInbjza;RJ0_@W"OYeInbj'#M5uhtpJ0_@#+VN-/'LIR.#+A/@R#+W"za;Rmt{VNXBDVtpA/@ROYe#+Vi1@OYeC]9A/@ROYeVi1@`j'LInbjk-'#M5'#M5tp
    
    encryption_dict = {'a': 'Inbj', 'b': 'IR.', 'c': '-/', 'd': 'M#F', 'e': 'W"', 'f': 'k-', 'g': 'a]', 'h': 'Vi1@', 'i': 'VN', 'j': 'tp', 'k': 'dN_', 'l': 'J0_@', 'm': 'C]9', 'n': 'mt{', 'o': "'L", 'p': 'U*DJ', 'q': '\\`)', 'r': 'XBDV', 's': "'#M5", 't': 'za;R', 'u': '#+', 'v': 'E&Is', 'w': 'uh', 'x': 'OYe', 'y': 'A/@R', 'z': '`j'}
    
    'vcgbnioocqxzksitjgccbwnmcmqvjyovivfkfdzinoniolmitlfkjcybpocwatlexaswjluicobuyuetnirjyxwxmyxhzoafssj'
    should equal
    'vcgbnioocqxzksitjgccbwnmcmqvjyovivfkfdzinoniolmitlfkjcybpocwatlexaswjluicobuyuetnirjyxuhxmyxhzoafssj'
    

    The "decrypted" result depends on the order of substitution (which is unknown), so the entire kata's premise is flawed.

  • Custom User Avatar

    Hi, just removed the function from the python translation of this kata. Thank you for pointing that out, sorry, took a short break so didn't notice it until now.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar
  • Custom User Avatar

    Error with your code, the input is a string of multiple characters not just one.

  • Custom User Avatar

    Not a suggestion.

  • Custom User Avatar

    Morse code isn't prefix safe.

  • Default User Avatar
  • Custom User Avatar

    hence handling the cuts of the string for the decoding

    Isn't that the (almost) same as morse code decoding?

  • Loading more items...