Function for MASS merge of duplicates

Function for MASS merge of duplicates

Is there a way for mass merge of duplicates and not only 3 at a time?