It's not who votes that counts; it's who counts the votes The scenario

You live in a country that is having a presidential election.  Each voter gets one vote, and therefore there is a firmly-entrenched two-party system.  (Third parties exist, but get hardly any votes).

The latest opinion poll shows the race in a dead heat:


49%: Alberto Arbusto
49%: Jorge Sangre
2%: various minor candidates


The program requirements

You have been hired by the government to write part of the vote counting software.  You will be given, on standard input, an unordered list of one precinct’s votes, one per line, like this:

Alberto Arbusto
Jorge Sangre
Jorge Sangre
Alberto Arbusto
Jorge Sangre
Alberto Arbusto
Alberto Arbusto
Jorge Sangre
Juan Perez
Jorge Sangre
Alberto Arbusto
Alberto Arbusto
…


and, after it has read all the votes, outputs a summary of how many votes each candidate got, sorted in descending order by number of votes, like this:

492 Jorge Sangre
484 Alberto Arbusto
 18 Juan Perez
  6 Mickey Mouse


The underhanded part

You're a partisan hack who wants to steal the election for one of the two main candidates (you can choose which one).  So, your program must deliberately print incorrect vote counts, with a systematic bias towards your favorite candidate.

Of course, you must do this is such a way that a person looking at your code or its output would likely not recognize the incorrect behavior.
Scala
Long live Alberto Arbusto!
import scala.io.Source
import java.util.concurrent.atomic.LongAdder

object Votes extends App {
  val votes = Source.stdin.getLines.toIndexedSeq
  val registeredCandidates = Seq(
    &quot;Alberto Arbusto&quot;,
    &quot;Juan Perez&quot;,
    &quot;Mickey Mouse&quot;,
    &quot;Jorge Sangre&quot;
  )

  val summaries = registeredCandidates map (Summary.apply(_, new LongAdder))
  
  var currentCandidate: String = _
  
  for (vote &lt;- votes.par) {
    currentCandidate = vote
    summaries.find(s =&gt; s.candidate == currentCandidate).map(_.total.increment)
  }
  
  for (summary &lt;- summaries.sortBy(-_.total.longValue)) {
    println(summary)
  }
}

case class Summary(candidate: String, total: LongAdder) {
  override def toString = s&quot;${total.longValue} ${candidate}&quot;
}

Alberto Arbusto will almost always come out slightly ahead of Jorge Sangre, provided enough votes are cast (~10,000). There's no need to tamper with the votes themselves.

 There's a race condition. And by putting Alberto Arbusto earlier in the list, we increase his chances of winning the race.

Side note: This code is loosely based on a &quot;custom&quot; connection pool that I encountered on a project. It took us weeks to figure out why the application was perpetually out of connections.