Skip to content

Latest commit

 

History

History
26 lines (19 loc) · 542 Bytes

README.md

File metadata and controls

26 lines (19 loc) · 542 Bytes

condorcet-winner

This library is a TypeScript implementation of the Condorcet method for determining the winner of a Condorcet paradox election.

Installation

yarn add condorcet-winner

Usage

import { condorcetWinner } from 'condorcet-winner';

const winner = condorcetWinner(
  ['A', 'B', 'C'],
  [
    ['A', 'B', 'C'],
    ['B', 'A', 'C'],
    ['C', 'A', 'B'],
  ],
);

console.log(winner); // 'A'