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.
Needs random tests.
Well, this is another kata about linear regression, which is a duplicate of https://www.codewars.com/kata/5515395b9cd40b2c3e00116c
Thank you
It's already explained just below.
This is an excellent solution. How did you come up with this logic? I don't understand the formula. Can you please explain me?
Where did you get this formula from please?
Done, thanks you for the suggestion
my bad, has been edited
I guess if either
js
orts
is zero, we can consider Jacob DOA and returnInfinity
;).What is the expected behaviour when
js === 0
?The function declaration seems odd.
The number of test cases is currently very low (4). Add some more and at least randomize their order. Even better, provide random test cases.
The initial solution is completely off. It doesn't have the same name as the mentioned, nor the same number of arguments. The name of the function can be guessed via the example tests, but that shouldn't be the user's task.
'Something went wrong'
isn't a helpful error message. Either provide helpful information or remove the message completely. EDIT: Completely as in "remove the third argument completely". Not "use the empty string".Quite strange initial solution
Loading more items...