Ad
  • Custom User Avatar

    Remove it. There're no final tests with n this big. If you indeed want to check your solution on this input (it's correct, I suppose), change the n type to long.

  • Default User Avatar

    Yea, I get that but I have no idea how to proceed. That's Why I'm asking for help. Out of ideas unless someone can give me a hint in the right direction. thanks.

  • Default User Avatar

    string[] names = new string[] { "Sheldon", "Leonard", "Penny", "Rajesh", "Howard" };
    Line.WhoIsNext(names, 1) == "Sheldon"
    Line.WhoIsNext(names, 52) == "Penny"
    Line.WhoIsNext(names, 7230702951) == "Leonard"

    this is some conditions of the task.

    and when I try to solve this task in my IDE, 7 230 702 951 - "the number is too large for int"

  • Custom User Avatar

    Reducing the time complexity is the whole idea of the kata -_-

    It should be at most O(log(n)) to pass the tests.

  • Default User Avatar

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

  • Custom User Avatar

    I couldn't find such test in Java...

    It seems there's no problem with n being so big even though it's stored as int.

  • Default User Avatar

    In descritption we see:
    "The input data consist of an array which contains five names, and single integer n.
    (1 ≤ n ≤ 1 000 000 000)."
    But in output/examples we must receive "Leonard" for n == 7 230 702 951.
    How can it be possible? It is more than int.