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.
Query length should not be less than or greater than 2. If it is, throw error.
This comment is hidden because it contains spoiler information about the solution
Добрый день!
Условия у данной Ката не отражают суть задачи.
Поэтому решил написать данное пояснение, возможно кому-то поможет не ломать голову.
У вас есть гипотенуза и катет в прямоугольном треугольнике.
readings - содержит 4ре значения.
const [[distance1, time1], [distance2, time2]] = readings;
Есть два подхода, чтобы учесть данное условие:
Обратите внимание, что ваш код должен быть способен обрабатывать показания, передаваемые в функцию в любом порядке.
Можно вернуть модуль числа при расчетах или просто изменить порядок элементов массива (distance1 > distance2)
На всякий случай формула прямоугольного треугольника: (A2 + B2 === C**2) (A/B - катеты) (C - гипотенуза)
Только нужно не забывать, что нам нужно относительное значение и в километрах в час.
Good day!
The conditions of this Kata do not reflect the essence of the problem.
Therefore, I decided to write this explanation, perhaps someone will help not to break his head.
You have a hypotenuse and a cathetus in a right triangle.
readings - contains 4 values.
const [[distance1, time1], [distance2, time2]] = readings;
There are two approaches to account for this condition:
Note that your code must be able to handle readings passed to the function in any order.
You can return the modulus of the number in the calculation, or you can simply change the order of the array elements (distance1 > distance2)
Just in case, the formula for a right triangle: (A2 + B2 === C**2) (A/B - cathetes) (C - hypotenuse).
Only we need to remember that we need a relative value and in kilometers per hour.
P.S. please explain in the problem that you have an angle to the road of 90 degrees (For est and act this is a very good explanation).
Solved...
I seem to be getting funny errors despite having solved this questions, any tips please?
Hello, I'm stuck on the solution of this Kata.
Basically I've solved, just I don't understand what kind of error this Kata expects from:
I used // throw new Error(""); but it seems to not be the solution expected by the author so any tips/ suggestion would be helpful
cheers
This comment is hidden because it contains spoiler information about the solution
Awesome Kata! Thanks!
Done
Added by someone.
the description should use language specific code blocks (or better, something language agnostic)
note: author is inactive.
In JS solution :
Test case does not meet description : speedError(8,2,[[5,1.82 ],[5,0.48]])
Value 8 is bigger then ~5.
Making radar position not perpendicular to road.
Tested some aprooved solutions and this breaks pythagorean calculations.
Math.sqrt(55 - 88) => NaN.
I liked this kata but need some improvements.
This kata caused me a lot of frustration but ultimately it was all down to a stupid error on my part. Since passing though, I've learned more JavaScript vocabulary and syntax from this kata than any JS kata I've done so far. So thank you very much for that!
Okay, thanks for clearing it up.
Loading more items...