6. Validity Checker / Functions and Arrow Functions
Изпитвам затруднение с превода на тази задача. Това което разбирам е че трябва да сравня кординатите с 0 и след това да ги сравня помежду си за съвпадение. При тест 5 в judge ми дава грешка. Моля някой да ми обясни какво точно се изисква в тази задача.
"
Validity Checker
Write a JS program that receives two points in the format [x1, y1, x2, y2] and checks if the distances between each point and the start of the cartesian coordinate system (0, 0) and between the points themselves is valid. A distance between two points is considered valid, if it is an integer value. In case a distance is valid write "{x1, y1} to {x2, y2} is valid", in case the distance is invalid write "{x1, y1} to {x2, y2} is invalid".
The order of comparisons should always be first {x1, y1} to {0, 0}, then {x2, y2} to {0, 0} and finally {x1, y1} to {x2, y2}.
The input consists of two points given as an array of strings.
For each comparison print on the output either "{x1, y1} to {x2, y2} is valid" if the distance between them is valid, or "{x1, y1} to {x2, y2} is invalid"- if it’s invalid.
"
Благодаря