Opening your workspace…
Workspace/Coding room
Opening your workspace…
You’re stuffing cheese wheels into your pack in Skyrim. Your pack can hold a certain total weight, and you also have other loot weighing you down. Each cheese wheel weighs 2 units. Find the most whole cheese wheels you can carry before your total weight goes over the limit and you can’t run.
100, 0Output50With 100 units free and each wheel weighing 2, you can carry 50 wheels.
100, 7Output46There are 93 units left, enough for 46 whole wheels (92 units).
Subtract the other loot before dividing the remaining capacity by two.
function solve(carry_limit, other_loot_weight) { // Write your solution here. }
Tab inserts two spaces. Shift+Tab outdents. Use the arrow keys and Tab to choose a suggestion. Press Escape, then Tab, to leave the editor. Press Control or Command with apostrophe to run samples or with Enter to submit.