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.
Not an exact duplicate, but very close to this: Two's Complement
Hi,
The description is still incorrect:
That's not at all what is asked for. The expected answer is
find the minimum amount of flips needed to terminate the porcess
.Ruby 3.0 should be enabled, see this to learn how to do it
How is the number of digits determined? If
45[10] = 101101[2]
has 6 digits, then0[10] = 0[2]
has digits, following the same logic (all numbers from 0 to 0 can be represented with 0 bits). If0
has 1 digit, then why should45
be101101
and not0101101
for example?Nice idea, but testing is ATM quite insuffucient indeed.
I haven't thought it through, but are there edge cases where negative numbers come into play? If so, you want those as fixed tests. Or you want to specify a more restricted input domain.
(Bitwise operators operate on 32-bit integers but JS internally represents up to 53-bit integers.)
But first, really, random tests! :]