Competed implementation of Triples.java for the second question in the 2012 UMD programming contest