improved pythag_triples code to use hashmap and dict