Ad
  • Custom User Avatar

    While I haven't submitted in JS, and I don't know if this is the case, what it looks like is that you are modifying the array in place, rather than making a copy. So the test cases create an array, then run your code on it. Then, in order to check your answer, they run their own doubling code on the same array. If you modified the array at all, then the answer won't be correct.

  • Custom User Avatar

    I'm also using JS and having the same problem. It looks like sample cases are working, but random are not. In fact, it looks like random cases are expecting a quadrupled answer instead of doubled, eg:

    Testing for 2,2,2,4,8,3 and 2

    It should work for random inputs too - Expected: '[8, 8, 8, 16, 32, 12]', instead got: '[4, 4, 4, 8, 16, 6]'

  • Custom User Avatar

    Same problem, with JavaScript. Solutions?

  • Custom User Avatar
  • Custom User Avatar

    Hi, which language?

  • Custom User Avatar

    test cases is bugged, need fixing:

    Random tests
    Testing for abbcbcaaab
    ✘ It should work for random inputs too - Expected: "abbcbcaaab", instead got: "baacacbbba"
    Testing for baaaabb
    ✘ It should work for random inputs too - Expected: "baaaabb", instead got: "abbbbaa"
    Testing for caccbcbbbbaa
    ✘ It should work for random inputs too - Expected: "caccbcbbbbaa", instead got: "cbccacaaaabb"
    Testing for aacaacb
    ✘ It should work for random inputs too - Expected: "aacaacb", instead got: "bbcbbca"
    Testing for accbc
    ✘ It should work for random inputs too - Expected: "accbc", instead got: "bccac"
    Testing for cbbbcbbac
    ✘ It should work for random inputs too - Expected: "cbbbcbbac", instead got: "caaacaabc"
    Testing for acaaaabcabbbaccbcaab
    ✘ It should work for random inputs too - Expected: "acaaaabcabbbaccbcaab", instead got: "bcbbbbacbaaabccacbba"
    Testing for bacacbbb
    ✘ It should work for random inputs too - Expected: "bacacbbb", instead got: "abcbcaaa"

  • Custom User Avatar

    test cases is bugged, need fixing:

    Random tests
    Testing for abbcbcaaab
    ✘ It should work for random inputs too - Expected: "abbcbcaaab", instead got: "baacacbbba"
    Testing for baaaabb
    ✘ It should work for random inputs too - Expected: "baaaabb", instead got: "abbbbaa"
    Testing for caccbcbbbbaa
    ✘ It should work for random inputs too - Expected: "caccbcbbbbaa", instead got: "cbccacaaaabb"
    Testing for aacaacb
    ✘ It should work for random inputs too - Expected: "aacaacb", instead got: "bbcbbca"
    Testing for accbc
    ✘ It should work for random inputs too - Expected: "accbc", instead got: "bccac"
    Testing for cbbbcbbac
    ✘ It should work for random inputs too - Expected: "cbbbcbbac", instead got: "caaacaabc"
    Testing for acaaaabcabbbaccbcaab
    ✘ It should work for random inputs too - Expected: "acaaaabcabbbaccbcaab", instead got: "bcbbbbacbaaabccacbba"
    Testing for bacacbbb
    ✘ It should work for random inputs too - Expected: "bacacbbb", instead got: "abcbcaaa"

  • Custom User Avatar

    really, why don't you explain the example then. What's clear in your head, doesn't mean it's clear on others.

  • Custom User Avatar

    nope, totally agreed with you. I am a several year computer science student and I can tell you that there are plenty of missing information. Trying to learn new language and test codewar, but there quite a few bugs on certain challenges. Good job at finding out the issue on this case.

  • Custom User Avatar

    woot, so I am not the only one with this issue

  • Custom User Avatar

    So... How do you make 2 test input arrays equal to the output when they are not...

    Test.assert_equals(sort_photos(["2016.img1","2013.img3","2016.img2","2015.img3","2012.img7","2016.img4","2013.img5"]),["2013.img5","2015.img3","2016.img1","2016.img2","2016.img4","2016.img5"])
    Test.assert_equals(sort_photos(["2016.img7","2016.img2","2016.img3","2015.img3","2012.img8","2016.img4","2016.img5"]),["2016.img2","2016.img3","2016.img4","2016.img5","2016.img7","2016.img8"])

  • Custom User Avatar

    Getting the same problem in both ruby and javascript.

  • Custom User Avatar

    I'm running into the same bug. It doesn't matter what I have it return, it is always expecting twice what I return:
    Test Results:
    Basic tests
    ✘ Expected: '[2, 4, 6]', instead got: '[10, 20, 30]'
    ✘ Expected: '[8, 2, 2, 2, 8]', instead got: '[40, 10, 10, 10, 40]'
    ✘ Expected: '[4, 4, 4, 4, 4, 4]', instead got: '[20, 20, 20, 20, 20, 20]'
    Completed in 6ms
    Random tests
    Testing for 8,6 and 3
    ✘ It should work for random inputs too - Expected: '[160, 120]', instead got: '[80, 60]'
    Completed in 1ms
    Testing for 2,5,6 and 4
    ✘ It should work for random inputs too - Expected: '[40, 100, 120]', instead got: '[20, 50, 60]'
    Testing for 8,9,9,3,6 and 5
    ✘ It should work for random inputs too - Expected: '[160, 180, 180, 60, 120]', instead got: '[80, 90, 90, 30, 60]'
    Testing for 9,8,1,1,9,6,1 and 9
    ✘ It should work for random inputs too - Expected: '[180, 160, 20, 20, 180, 120, 20]', instead got: '[90, 80, 10, 10, 90, 60, 10]'
    Testing for 2,7,8,3 and 3
    ✘ It should work for random inputs too - Expected: '[40, 140, 160, 60]', instead got: '[20, 70, 80, 30]'
    Completed in 1ms
    Testing for 3,8 and 5
    ✘ It should work for random inputs too - Expected: '[60, 160]', instead got: '[30, 80]'
    Completed in 1ms
    Testing for 4,8,5,3,8,8,3,5 and 9
    ✘ It should work for random inputs too - Expected: '[80, 160, 100, 60, 160, 160, 60, 100]', instead got: '[40, 80, 50, 30, 80, 80, 30, 50]'
    Testing for 1,7,2,8,8,1 and 4
    ✘ It should work for random inputs too - Expected: '[20, 140, 40, 160, 160, 20]', instead got: '[10, 70, 20, 80, 80, 10]'
    Completed in 1ms
    Testing for 7,2,2,8,7 and 8
    ✘ It should work for random inputs too - Expected: '[140, 40, 40, 160, 140]', instead got: '[70, 20, 20, 80, 70]'
    Completed in 1ms
    Testing for 4,8,2,7,3,3 and 8
    ✘ It should work for random inputs too - Expected: '[80, 160, 40, 140, 60, 60]', instead got: '[40, 80, 20, 70, 30, 30]'
    Testing for 4,9,1,7 and 9
    ✘ It should work for random inputs too - Expected: '[80, 180, 20, 140]', instead got: '[40, 90, 10, 70]'
    Testing for 1,7,8,4,4 and 6
    ✘ It should work for random inputs too - Expected: '[20, 140, 160, 80, 80]', instead got: '[10, 70, 80, 40, 40]'
    Testing for 8,2,6,7,9,7,7 and 3
    ✘ It should work for random inputs too - Expected: '[160, 40, 120, 140, 180, 140, 140]', instead got: '[80, 20, 60, 70, 90, 70, 70]'

  • Custom User Avatar

    Same problem. Don't know what to do.

  • Custom User Avatar

    Same issue. I dont think copying to a new array actually matters.

  • Loading more items...