If duplicates is present then print ArrayList
if ( ifPresent == true ) { cout << " [ " << al [ 0 ] << " , ▁ " ; for ( int i = 1 ; i < al . size ( ) - 1 ; i ++ ) { cout << al [ i ] << " , ▁ " ; } cout << al [ al . size ( ) - 1 ] << " ] " ; } else { cout << " No ▁ duplicates ▁ present ▁ in ▁ arrays " ; } }