Removing duplicates if occurs more than two times. Really cool solution