The correct answer is (b), contest.
A contest is a competition between two or more people or groups to see who is the best at something. It can be a physical activity, such as a race or a game, or it can be an intellectual activity, such as a quiz or a debate. Contests can be formal or informal, and they can be for fun or for a prize.
The other options are not synonyms of the word “competition.”
(a) Fight is a physical confrontation between two or more people, usually with the intention of harming each other.
(c) Legal is something that is in accordance with the law.
(d) Competence is the ability to do something well.