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.
I am not sure how to handle drastic changes like these. Do you think this is a necessary change to sustain the integrity of the kata?
TypeScript fork
bigint
s instead ofNumber
s, fixing this issue and this suggestionwarning: this will invalidate all current solutions
Thank you! :)
your test cases only call the function once and do not seem to test if the function behaves properly with multiple instances, while also not having the same test cases as the original tests (skipping ahead to random indices and checking that random segments behave like fibonacci sequences). can you check if the test cases will test properly when multiple instances of the same stream is invoked?
Prolog translation
OCaml translation
Very easy to read actually
what if num = 0
the return will -0
your solution not suitable
if number already negative then returning will be positive - * - = +
this is simple solution!!!
This comment is hidden because it contains spoiler information about the solution
Yes, in your case an empty array is acctually seen true in js.
The Boolean callback fn passed in the filter method only FILTERS those who are falsy, and if you are not sure which vals in js are falsy, this link may help:"https://developer.mozilla.org/en-US/docs/Glossary/Falsy".
Again, the result is 3 in your case and it's acctually prove this solution is right, cause only falsy vals are filtered.
Hope my belated comment helps!
Yes, it works this way, and your answer would be 7. But it's not what the kata asks.
Wouldn't it be 7? -7 * -1 = 7. Or it doesn't work this way?
What if the input was
-7
?Loading more items...