Ad
  • Custom User Avatar

    I think the initial test cases are very deceptive here. There is no indication of multiple mutations of the string until you go to attempt, at which point you are also dealing with extremely long strings. I suspect the instructions could be clearer. Since I honestly cannot solve it as is, though, it is possible I am just missing something.

  • Custom User Avatar

    The kata doesn't make it clear enough that this kata is about reversing an arbitrary, supposedly random bit swapping mapping, not reverse engineering the implementation of encrypt. These two directions are vastly different; taking the latter path is completely fruitless, and means wasting a lot of meaningless time.

  • Custom User Avatar

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

  • Custom User Avatar

    can somebody explain math behind it? how did you even came up with this solution?

  • Custom User Avatar

    rearranges the bits in the message

    There are 10000+ length messages in the random tests. If bits are rearranged in the message, that means a search space of size 2 ** 5000, which can never be solved on CodeWars ( or in the actual Universe ).

    Or I read something wrong in the description. For which I blame the description, actually.

    What am I missing?

  • Custom User Avatar

    Step 3: Pick out the duplicate characters in the first string and the other string, and then pick out the duplicate characters in the second string and the other string, and then third.. and so on..:

    It's unclear if I should just be looking at the next characters as in the sample. What about a group 3 that is ['abmxxz', 'abccmxz']. What would the answer be?

  • Custom User Avatar

    You can throw multiple eggs if you want, but only from one floor. Since they are identical, I can't think of a reason to do so unless in (2,14) you just want to throw two eggs from floor 105 at the end so you don't have to carry the last one down.

  • Custom User Avatar

    What have you thought of so far?

  • Custom User Avatar

    The question asks for the highest skyscraper where you can guarantee the highest floor you can drop an egg from. It's possible you cannot even determine if you can throw an egg from the first floor (if you have no eggs or no throws), so in that case you can't guarantee any floors, so the maximum skyscraper height is 0, or no skyscraper. The 'target floor' represents a floor where you can toss the egg from. You can't toss an egg from floor 0 (the first floor is floor 1), but you can report 0 meaning you can't determine the floor for any skyscraper with more than 0 floors.

  • Custom User Avatar

    Um, how do you delete a comment?

  • Custom User Avatar

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

  • Custom User Avatar

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

  • Custom User Avatar

    So yes there's a trick to it?

  • Custom User Avatar

    The paths are directly from one letter to another in a straight line. I think of it as 'Blocking' letters, for example E is blocking the path from A to I. If you think about the problem it makes sense because if you tried to move your finger from A to I and had not visited E yet, your finger would move over E and trigger it as the next node. For example if you do count_patterns_from('A', 1) and try to do A->I with your finger, you'll run into E and end up with A->E. The problem does mention this at least now:

    Take into account that dots/points can only be connected with straight directed lines ...

  • Custom User Avatar

    I had the same problem, turns out I missed one of the blocking paths, E blocking H -> B...

  • Loading more items...