Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Ok, now I see. Thx
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?
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 ??
I was confused what 'invalid sequence' was. I would add an example of invalid sequence and a test for invalid sequence to basic tests.
This comment is hidden because it contains spoiler information about the solution
It would be good if a more detailed description (satating how big reducion of number should be done) has been developed.