Max Distance Between Same Elements