Algorithm · Square · Easy
You are given a set of candidates, and each candidate is described by three attributes: a name, a power value, and an id. The candidates compete in a round-robin format, meaning each candidate faces every other candidate exactly one time. In any single match, the candidate whose power is greater wins. When both candidates have the same power, the candidate with the smaller id is the winner. Design this tournament and print its result. Examples Example