Ad
  • Custom User Avatar

    A person can give you a work_pass even if it's not required and you'll have to check if it's valid and not expired.

  • Custom User Avatar

    What regex can consistently get countries from string like these:

    "Citizens of Impor, Arstotzka require passport"
    "Citizens of Kolechia require passport"
    "Deny citizens of Arstotzka, United Federation"
    

    I solved it without regex (check solution because spoiler)

  • Custom User Avatar

    Thanks for helping us to kill the time. Good, complex and fun.

  • Default 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
  • Default User Avatar

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

  • Custom User Avatar
  • Default User Avatar

    Perhaps my description of the kata will make more sense:

    Description
    Amidakuji is a lottery method designed to create random pairs between two sets of the same size.In this kata the elements of the first set are whole numbers from 0 to 6. Your task is to write an amidakuji function that returns second set comprised of converse numbers.

    Input
    Your function will receive an array of equal-length strings consisting of 0 and 1 characters; this represents the "ladder" structure. The 1 represent the rungs of the ladder and the 0 represent empty space.

    const ladder = [
        '001001',
        '010000',
        '100100',
        '001000',
        '100101',
        '010010',
        '101001',
        '010100'
    ];
    
    amidakuji(ladder); // [4, 2, 0, 5, 3, 6, 1]
    

    Take a look at the diagram below:

    Row 0 of the ladder is '001001' string, which means there will be two horizontal bridges at this row; one between the vertical lines 2 and 3 and another between vertical lines 5 and 6. When proceed to move down vertical lines, a transition is made to the adjacent vertical line over the nearest bridge.

    Output
    The diagram above is a visual representation of ladder argument of the function.
    At the top of the diagram the 2 has a third position, in the aftermath of the ladder it got a second position. The yellow highlighted path shows the path taken by the 2 value. Every time it encounters a bridge, it moves to the opposite vertical line.

    Your function should return an array of numbers, with each number in its final position.

  • Default User Avatar

    This kata is challenging enough. Most of 6 kyu kata I could write shorter. I think it can be shorter than I wrote but I gave up to find the shorter one.

  • Custom User Avatar

    Great kata on dynamic programming, keep it up.

  • Custom User Avatar

    Approved

  • Custom User Avatar

    The array size is known and fixed. This runs in O(1).

  • Custom User Avatar
  • Default User Avatar

    thanks,mine is O(n^6)

  • Loading more items...