If you want to play violin concertos in binary, study Hacker's Delight. But frankly – unless you're writing an optimizing compiler or similar low-level stuff, this isn't important. May be the opposite, if it leads to cryptic code. I wrote this kata just for fun, it's not meant to be useful. :-)
All for you, my friend!
Also you can try my others katas, part of them are the same difficult
User solved this in PHP only.
I found no issues with their solution & the random tests (positive number tested only) that prevent them from passing this kata.
Resolving this. (to blame cosmic bit flips)
Forked and approved
This comment is hidden because it contains spoiler information about the solution
There's a "bug" in your solution, try checking with input
$num = 696
and see what is wrong.Not a kata issue.
https://www.codewars.com/kata/58311536e77f7d08de000085/discuss/javascript#5831c25bb3081b161c00005f
This comment is hidden because it contains spoiler information about the solution
If you want to play violin concertos in binary, study Hacker's Delight. But frankly – unless you're writing an optimizing compiler or similar low-level stuff, this isn't important. May be the opposite, if it leads to cryptic code. I wrote this kata just for fun, it's not meant to be useful. :-)
Just tried it on the language you used, PHP. Nope, nothing different. There's nothing wrong with using mod.
Not a valid kata issue, marking as resolved.
There's literally nothing wrong with using mod operator. Unless it has different behaviour on certain number in your language?
We can't read your mind, please give actual details.