Ad
  • Custom User Avatar

    You have a bug in your code. Double check for invisible characters.

    There should be no trailing white space at the end of each line, or new line characters at the end of the string.

  • Custom User Avatar

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

  • Default User Avatar

    Thanks a lot

  • Custom User Avatar

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

  • Custom User Avatar

    Nice kata, you do however need a negative test case as well as a test case that doesn't use assert_equals (Ruby) See @danielpclark's solution, which cheats your entire test suite.

  • Default User Avatar

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

  • Custom User Avatar

    Can you post your full solution as a spoiler comment?

  • Custom User Avatar

    @joshrainwater that's not an issue as it doesn't affect the test outcome and is just the character not rendering properly on the site. However, to get rid of the confusion I reduced the dimension for that test case so it renders correctly.

  • Default User Avatar

    Could you please answer? In a 44 block, i have 12 spaces, and 3 newlines. In 55, 20 spaces, 4 newlines, Isn't that correct?

  • Custom User Avatar

    I've noticed in my test output, in the sample, there are a couple undefined characters mixed in the sample output somehow on the longer test that makes it fail.

    ■ □ ■ ��� ■ □ ■

    Maybe that's causing issues? Is it a Unicode issue here as well maybe?

  • Default User Avatar

    This is the output i get:
    var res = string.split(" ");
    document.write(res);
    □,■,□,■ ■,□,■,□ □,■,□,■ ■,□,■,□
    var res = string.split("\n");
    document.write(res);
    □ ■ □ ■,■ □ ■ □,□ ■ □ ■,■ □ ■ □
    Isn't this what you ask for?

  • Custom User Avatar

    Check for extra white space or new line characters. From the description:

    There should be no trailing white space at the end of each line, or extra new line characters at the end of the string.

  • Default User Avatar

    Hello,
    It appears that i have the same issue. I'm writing with JS, and the output is the exact same of what's requested, but says not a match. The space, and new lines are in place.
    Could you please see what's going on, or if you want, see my code?

  • Custom User Avatar

    Hi,

    Python: I am getting timeout issue.. not sure why

    when I run it on my system with below tests, it takes only <=500ms
    print nextPrime(2,3)
    print nextPrime(20,300)
    print nextPrime(32144322,23452625233)
    print gap(4,100,110)
    print gap(4,30000,100000)
    print gap(2, 10000000, 11000000)
    print gap(2, 100000000, 110000000)
    print gap(2, 10000000000, 11000000000)
    print gap(2, 100000000000, 110000000000)
    print gap(2, 100000000430000, 1100000000056450)
    print gap(84, 432560923690632432, 93274782356043246324324)


    I tried some hacks..

    this fails as expected (None should equal [30109, 30113])
    def gap(g, m, n):
    if n > 11000:
    return None

    while, this times out
    def gap(g, m, n):
    if n > 110000:
    return None

    my script might not be meeting 6sec requirement, but I don't think it should fail like this.. especially as much bigger number on my system does within 500ms..

    any suggestions?

  • Default User Avatar
  • Loading more items...