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.
Duplicate issue: https://www.codewars.com/kata/5805ed25c2799821cb000005/discuss#5bed888b358dda51630001cf
fixed
when the lenght of array1 equal 0 function will return array2
and the lenght of array2 equal 0 function will return array1
You're reading the logs wrong, the log appears above the test result. And the parity of the decimal representation of the number doesn't matter, this is about the number of 1s in the string. Just add the number (1 or 0) at the end. If you check the Wikipedia link in the kata description, it is explained.
It doesn't matter, you want the number of 1s to be either odd or even.
You just need to click on Attempt rather that the CTRL+S shortcut. There are tests on the back-end. I was also initially confused about this, but figured it out after console logging 'hello' and running an Attempt. Hope it helps!
For the given example
(45 11 100) is the input. This means 45 carbon, 11 hydrogen and 100 oxygen.
Then you need to determine how many H2O, CO2 and CH4 will be made. The order is determine H2O first, then CO2, then CH4
So, for (45 11 100) you first make H2O.
You can make 5 H2O (as this requires 10 hydrogen and 5 Oxygen)
This leaves you with (1 Hydrogen, 95 Oxygen, 45 carbon)
Now make CO2
You can make 45 CO2 (as this requires 45 Carbon and 90 Oxygen)
This leaves you with (1 Hydrogen, 5 Oxygen and 0 Carbon)
Now make CH4, you can't make any CH4 as you have no carbon and only 1 hydrogen.
So the result is (5, 45, 0)
Does this help?