Ad
  • Custom User Avatar

    Actually it is not my tests. It is the node version that the code is running. For some reason I still can't change it. It doesn't matter if I change it to Node v6.0.0/Babel, it stills sets to Node v0.10.33, and this version doesn't allow arrow functions.

    The error that you are seeing there (const require = _ => void 0;) is an internal error of codewars regarding to arrow functions.

    I'll still try to change it, but don't know if I will be able to.

  • Custom User Avatar

    This proposal is different comparing to other similar katas. I don't think it is a duplicate.
    If someone else thinks it is duplicated i will reconsider this.

  • Custom User Avatar

    I don't think this kata should be perfect in this tests you mentioned. If someone else opens a issue like that I will reconsider.

  • Custom User Avatar

    Couldn't reproduce and there is a lack of explanation.

  • Custom User Avatar
  • Custom User Avatar

    Codewars wasn't allowing me to change the node version to allow arrow functions. And my code was running on an older version (donno why).
    It seems to be fixed and I could change it now.

    This should be ok now. Let me know if it is solved.

  • Custom User Avatar

    In a chromosome of length ${l}, running enough times it should be able to return all 2^${l} possibilities

    In the javascript tests you can see that I don't verify all possible combinations. In 2000 runs I test if the positions have changed at least once somewhere. The l is not fixed as well. Check the javascript test to implement the same test please.

  • Custom User Avatar

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

  • Custom User Avatar

    Actually the test is not expecting you to find out all the possibilities inside those combinations, but it checks if each position had permuted between 0 and 1 at least once.

    Trying to explain it better:

    in a string of length 4 (length is not fixed in this test), in a total of 2000 runs, the position [0] should be 1 in some case but also have to be 0 somewhere else:

    1011

    0110

    This way I expect you not to have a hardcoded solution, verifying if all your elements inside the string array actually changes.

  • Custom User Avatar

    Which language are you using?

    In javascript I can see the following tests for this case:

      Test.assertEquals(generate(0).length, 0);
      Test.assertEquals(generate(1).length, 1);
    
  • Custom User Avatar

    It is actually a bug related to code wars. I can't set the node version to babel and it doesn't support arrow function as default.
    When it gets fixed I update it here.

    Thank you for the feedback.

  • Custom User Avatar

    Can you specify the error, please?

  • Custom User Avatar

    Better late than never.
    Just accepted. Thanks.

  • Custom User Avatar

    Good catch! thanks

  • Custom User Avatar

    A Quicksum packet allows only uppercase letters and spaces. It always begins and ends with an uppercase letter.

    Random test inputs have white space at the end.

    A real example that just happened:

    input: XWYTKPSWY HXHULYRUMO 
    Expected: 3503, instead got: 0
    input: GLECQNHBIM 
    Expected: 510, instead got: 0
    

    My algorithm sees that it doesn't end with A-Z and returns 0, but it expects the same result as it was ending with A-Z.

  • Loading more items...