Ad
  • Custom User Avatar

    'refb l miq hj ko n g p a c d '
    This test and some other tests fail because of the ORDER of the elements in the resulting array. But according to the description of the kata the order should not be taken into account!
    The fail message is that the test expects the first element to be 'g', but my code makes it a 'c', which is correct too and it's just the second element in the tests, not the first like I have it.

    PS: To make the tests order-insensitive you could use this code instead:
    assertThat(LoneChar.loneliest("refb l miq hj ko n g p a c d ")).containsExactlyInAnyOrder('g', 'c');

  • Custom User Avatar

    the string can have leading/trailing spaces - you should not count them

    And it has been already asked and answered here

  • Custom User Avatar

    how the output will be "g"
    assert.deepEqual(loneliest('abcXdXXXefXXgXXXhXiXjXXXXXX'), ['g'], "result");
    g = XXgXXX = 5
    j = XjXXXXXX=7
    Answer should be J instead of g