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.
What is going on?
Time: 2708ms Passed: 0Failed: 4Exit Code: 1
Test Results:
Fixed_Tests
Basic_Tests
Expected: equal to [8.6667, 6.6667]
Actual: [8.6667, 6.6667]
Random_Tests
Moderate_Values
Expected: equal to [33, 37.3333]
Actual: [33, 37.3333]
High_Values
Expected: equal to [642.333, 895.667]
Actual: [642.333, 895.667]
Huge_Values
Expected: equal to [4697.33, 6422]
Actual: [4697.33, 6422]
It makes perfect sense, if you don't start making up your own rules. You need to follow the rules of the kata, not what you believe. "distance", as you desribe it, is irrelevant here.
Point # 3 doesn't make sense, logically & practically. Just having 2 non-opposite directions adjoining to eachother, doesn't reduce their effects overall unless you have distance in the play.
What update would you suggest? Because the description tells you MULTIPLE times about this quality to the kata task.
Going to one direction and coming back the opposite direction
right awayis a needless effort.
You can immediately see that going "NORTH" and
immediately"SOUTH" is not reasonable, better stay to the same place!
"NORTH" and "WEST", "WEST" and "SOUTH", "SOUTH" and "EAST" are not
directly oppositeof each other and can't (be reduced).
And for that matter very test case we're talking about is literally discussed directly in the
Notes
section.Then the task explanation needs updation...
if i follow {"NORTH","WEST","SOUTH","EAST"}, i am wasting my energy because it will bring me to the same point. The sequence doesn't matter...
You misunderstand the task.
The correct answer to the
Fixed Test
you showed is{"NORTH","WEST","SOUTH","EAST"}
, because there are no consecutive opposite directions to reduce.Following test cases seem invalid;
Please check other random test cases as well...
This comment is hidden because it contains spoiler information about the solution
Was already marked as spoiler.
Thank you for the pointer.
The "sample tests" block of the "Attempt" contain more assertions than those of the "Test", this is why you pass the latter but not the former.
Your code throws an error when
ending
is longer thanstr
.Please, do not raise issues to ask for help; a bug in your code is not a kata issue; you can ask questions instead. When you post your code, don't forget to add the spoiler flag and to format with Markdown
Sorry, no error in the tests. Kata passed by 85,171 people...
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution