This library is a TypeScript implementation of the Condorcet method for determining the winner of a Condorcet paradox election.
yarn add condorcet-winner
import { condorcetWinner } from 'condorcet-winner';
const winner = condorcetWinner(
['A', 'B', 'C'],
[
['A', 'B', 'C'],
['B', 'A', 'C'],
['C', 'A', 'B'],
],
);
console.log(winner); // 'A'