If anyone wants independent verification of the true results (which are actually worse for Beer, as my previous code thought "Kurn" and "son of Mogh" were two independent valid voters) you can use this:
https://jsbin.com/safelacegu/1/edit?js,console
I put this code online so anyone can see the result, but if you're worried about me doing shenanigans or something you can take these steps yourself and run it on jsbin:
Code:
let fixKurn = arr => {
arr.splice(arr.indexOf('Kurn'), 1)
arr.splice(arr.indexOf('son of Mogh'), 1)
arr.push('Kurn, son of Mogh')
}
let voterList = "<paste full comma-separated voter list here>".split(', ')
let beerVoters = "<paste full comma-separated list of Beer voters here>".split(', ')
let aocVoters = "<paste full comma-separated list of AOC voters here>".split(', ')
fixKurn(voterList)
fixKurn(beerVoters)
let beerInvalid = beerVoters.filter(name => !voterList.includes(name))
let aocInvalid = aocVoters.filter(name => !voterList.includes(name))
console.log('Madison Beer got ' + beerVoters.length + ' votes, but ' + beerInvalid.length + ' are invalid, leaving her with ' + (beerVoters.length - beerInvalid.length))
console.log('AOC got ' + aocVoters.length + ' votes, but ' + aocInvalid.length + ' are invalid, leaving her with ' + (aocVoters.length - aocInvalid.length))
AOC 141
Beer 139
Lektor 0