• Custom User Avatar

    Simple! nice one.

  • Custom User Avatar

    Hmmm... Iterating through the list is better than popping off the list?
    Popping all the elements off a list takes O(cn) time if c = "lag time" for each popping.
    Iterating through all elements of a list takes O(n) time.

    So although iterating might be faster, in terms of asymptotic runtime, both take the same time.
    ...Unless c contains a term of n (i.e. log(n), n, n^2)?

  • Custom User Avatar

    There. Added a warning about not changing input data.
    Are you sure that popping off moves is the right/best approach?

  • Custom User Avatar

    Hello everyone,

    There is an issue with the code. If you mutate ANY of the parameters, such as popping off of moves, the random test case fails.
    I read the question again and it doesn't appear to tell that inputs should not be mutated. Please add this warning to the problem.

    Essentially, the moves list must not only be copied, but deep copied so the original moves list doesn't get mutated.
    Just so this post doesn't spoil the answer, I will leave it up to the reader to figure out how to deep copy.

  • Custom User Avatar
    moves = ["right","right","right","right","right","down","left","down","down","up","down","up","left","right","right","up"]
    describe("Solution", function(){
      it("should work", function(){
        console.log(streetFighterSelection(fighters, [0,0], moves));
        Test.assertSimilar(streetFighterSelection(fighters, [0,0], moves), [ 'E.Honda', 'Blanka', 'Guile', 'Balrog', 
        'Vega', 'M.Bison', 'Sagat', 'Sagat', 'Sagat', 'Balrog', 'Sagat', 'Balrog', 'Guile', 'Balrog', 'Vega', 'Vega' ]);
      });
    });
    

    no? I think 92 other people beg to differ.

  • Custom User Avatar

    In Javascript, test entitled 'should work' appears to input empty moves parameter. I think this is a bug?

  • Custom User Avatar

    Nice Kata, thank you.

    I get all tests passed but I get the following error when I "Attempt/Submit". How do I debug? I checked all the test cases listed and my code runs without fine.

    STDERR:
    Traceback:
    in
    in street_fighter_selection
    IndexError: list index out of range

  • Custom User Avatar

    Thank you!
    Description updated, please check. :>

  • Custom User Avatar

    Nice Kata but a bit more description would have been helpful or at least one more tower would have saved time understanding it easily. Otherwise, I loved it! thank you.