Ad
  • Custom User Avatar

    Ok, now I see. Thx

  • Custom User Avatar

    Ok, but in first case:

    var friends1 = ["A1", "A2", "A3", "A4", "A5"];
    var fTowns1 = [["A1", "X1"], ["A2", "X2"], ["A3", "X3"], ["A4", "X4"]];
    var distTable1 = ["X1", 100.0, "X2", 200.0, "X3", 250.0, "X4", 300.0];
    Test.assertEquals(tour(friends1, fTowns1, distTable1), 889);

    Distances between the citeis are:

    173.20508075688772 -> floor = 173
    150 -> floor = 150
    165.83123951777 -> floor = 165
    sum + = 488 + 100 + 300 = 888,

    and the actual result You are looking for in test case is 889.

    So in first case round is used, and in third floor. Am I not getting something?

  • Custom User Avatar

    Can You please explain me why answer to 3 tasecase should be 168?

    var friends3 = ["B1", "B2"];
    var fTowns3 = [["B1", "Y1"], ["B2", "Y2"], ["B3", "Y3"], ["B4", "Y4"], ["B5", "Y5"]];
    var distTable3 = ["Y1", 50.0, "Y2", 70.0, "Y3", 90.0, "Y4", 110.0, "Y5", 150.0];
    Test.assertEquals(tour(friends3, fTowns3, distTable3), 168);

    Imo - exect distance is 50 + 48,98 + 70, so I asume that after rounding it should be 169 rather than 168 ??

  • Custom User Avatar

    I was confused what 'invalid sequence' was. I would add an example of invalid sequence and a test for invalid sequence to basic tests.

  • Custom User Avatar

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

  • Custom User Avatar

    It would be good if a more detailed description (satating how big reducion of number should be done) has been developed.