Java Arraylist And Hashmap Complexity Gaming