The correct response to the question is:
Hydrogen shares one valence electron with carbon, and oxygen shares two valence electrons.
This is the best explanation for why carbon forms four bonds with hydrogen in methane, where each hydrogen atom shares one electron with carbon, and two bonds with oxygen in carbon dioxide, where each oxygen atom typically shares two electrons with carbon (forming double bonds).