Draft
Burning Coal with Hydrogen!
Description:
Given the number of atoms of Carbon [C],Hydrogen[H] and Oxygen[O].
Calculate how many molecules of Water [H2O] and Carbon Dioxide [CO2] will be produced if Hydrogen reacts before Carbon.
Reaction:
2 atoms of [O] reacts with 4 atoms of [H] = gives 2 molecules of [H2O].
2 atoms of [O] reacts with 1 atom of [C] = gives 1 molecule of [CO2].
Note that Oxygen exists in pairs. So we need 2 pairs of H2(4 atoms) to react with Oxygen atoms.
FOR EXAMPLE:
(C,H,O) = (45,11,100)
return water and carbon dioxide in the following order as a string
Output should be like:
'4:45 is the water carbondioxide ratio'
(no need to simplify ratio)
Similar Kata:
Stats:
Created | Dec 18, 2020 |
Warriors Trained | 35 |
Total Skips | 2 |
Total Code Submissions | 118 |
Total Times Completed | 24 |
Python Completions | 24 |
Total Stars | 1 |
% of votes with a positive feedback rating | 68% of 20 |
Total "Very Satisfied" Votes | 11 |
Total "Somewhat Satisfied" Votes | 5 |
Total "Not Satisfied" Votes | 4 |
Total Rank Assessments | 19 |
Average Assessed Rank | 7 kyu |
Highest Assessed Rank | 6 kyu |
Lowest Assessed Rank | 8 kyu |