#JavaScript (ES6) 333 331 329 223 characters
JavaScript (ES6) 333 331 329 223 characters
Many thanks to ETHproductions and Neil, 100+ characters thanks to both of you, and I haven't tried findIndex() yet :-)
s=>(d="0,;y\\>|Kb^6 |kn|xw|r?||8MD|hQ|EU|7|2||R|e||||F|||||||||G".split("|"),d[35]="",d[52]="3",d.map((a,j)=>{if(~a.indexOf(String.fromCharCode([...s].reduce((S,c)=>S*32+c.charCodeAt(),0)%153)))o=j}),o+3)
Expanded version
(With \0xx instead of characters)
s => (
d = "0,;y\\>|Kb^6\t|kn\x1D|\x05\x7F\x84x\bw|r\x12?|\x07\x98|8MD|\x93h\x8E\x11Q|\x8FEU\x1B|7|2|\v|R|\x92e||\x19||\x04F|||||||||\x94G".split("|"),
d[35] = "\x13",
d[52] = "3",
d.map(
(a,j) => {
if(~a.indexOf(
String.fromCharCode([...s].reduce(
(S,c)=>S*32+c.charCodeAt(),0)%153)
))
o = j
}
),
o+3
)
Approach:
Preprocessing:
Calculate an hash of each state name and store them in an array where one dimension is the number of votes the state has.
Processing:
Recalculate the hash and retrieve the information.
An hash of a state name is calculated with s.split('').reduce((S,c)=>S*32+c.charCodeAt(0),0)%153
.
It transform "Iowa" in (32^3*'I' + 32^2*'o' + 32*'w' + 'a')%153
(with ascii value for characters).
Why 32 and 153? Because after a few empiric tests those values minimize hashes without collision between states that have different number of votes.
I don't believe that it will be hard to do something shorter with a better approach but since I spent a few time on it ;).