Implement function to find duplicated keys.