Ad
  • Custom User Avatar

    Your code fails for cases like two_sums([2, 2, 3], 4) as .index only checks the 1st position of that element in the list and not its corresponding position, so for the case above the right index should be 0, 1 but your code checks for .index --> 0 != 0 --> False, so it skips that condition.

  • Custom User Avatar

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

  • Default User Avatar

    I get you, the description is a little difficult to understand, and staring at the examples don't really help.

    Essentially what the description is telling you to do (to encrypt) is to split the string(s) into two groups, one group is the parts of the string at an odd index location, and the other group being the parts of the string at an even index location. Then simply combine these two groups and you have the encryption method.

    And you have to repeat this n number of times.
    I hope that clears it up for you - and I don't believe anything I wrote here is a spoiler, it's merely a rewriting of the description (people can be a little heavy handed with flagging spoiler content, and that may stop you and others from seeing it if needed).

  • Default User Avatar