Skip to content

Latest commit

 

History

History

Help the farmer to count rabbits, chickens and cows

Farmer Bob have a big farm, where he growths chickens, rabbits and cows. It is very difficult to count the number of animals for each type manually, so he diceded to buy a system to do it. But he bought a cheap system that can count only total number of heads, total number of legs and total number of horns of animals on the farm. Help Bob to figure out how many chickens, rabbits and cows does he have?

All chickens have 2 legs, 1 head and no horns; all rabbits have 4 legs, 1 head and no horns; all cows have 4 legs, 1 head and 2 horns.

Your task is to write a function

get_animals_count(legs_number, heads_number, horns_number)

, which returns a dictionary

Parameters legs_number, heads_number, horns_number are integer, all tests have valid input.

Try it yourself