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.
Please use spoiler flag next time, your post was visible in the homepage.
This comment is hidden because it contains spoiler information about the solution
Clean af.
Interesting...
added to all languages
Вот это я понимаю настрочил, то чувство, когда платят за количество написанных строк))
This comment is hidden because it contains spoiler information about the solution
This isn't even good. You're recreating a huge array every time this is called. And the other option isn't very good either because you'd have a giant array just taking up memory.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Changed the note to "Zero (0) is not checked for any specific sign. Negative zeros make no mathematical sense."
Thanks for the feedback. XD
I really appreciate that, thanks man.
@Firefly2002: yes, indeed i did. However, after the new note, i simply removed my vote, as i feel i would not have done so, had the note already been in place. The voting is "How satisfied are you with this kata?", which is rather subjective. In this case, i spent more time reading about some library i am not interested in (for mentioned reasons), than actually solving the problem. It was also an unexpected issue, i thought the library would not cause problems for such straight-forward use. This caused me to be slightly unhappy about the kata, which, for a voting system like this, which is not fine-grained enough for a "slightly unhappy", results in the related vote.
@FArekkusu: Iirc the mentioned note was not there when i solved the kata. You coming here, just to write something like this, should tell anyone who was not involved a lot already. For anyone bored enough to wonder, here is the related debate he is referring to: https://www.codewars.com/kata/return-negative/discuss/javascript - it's the issue that was posted by me and has 17 replies. PS: this part of the answer got cut short, due to me following advice from people i asked about the situation, which was "don't waste your time with people like that".
No use talking to him. It's not the first time I see this user bitching because JS doesn't work the way he wants - be it present or not present language features.
Apart from that, there's a big message at the top of the description telling that you will have to use the library. If you don't know its subtleties, you shouldn't try (or at least ask for help, as there's another A LOT faster method for rounding BigNumbers).
If you downvoted this because you didn't like the library, take it up with CodeWars (although I'd ask you to reconsider); it's the only BigInt library we've got access to, so it's the only option I had if I wanted to still offer it in JavaScript. You're free to complete it in Python, Ruby or Haskell, btw, all of which natively support big integers.
Additionally, if you took a look at other solutions, you'll see
toString(10)
isn't actually necessary.Loading more items...