Check if both left and right parts are present in a [ ]
if ( cnt [ left ] == 1 && cnt [ right ] == 1 ) { ans = false ; Console . Write ( b [ i ] + " ▁ " ) ; } } } if ( ans ) Console . Write ( " - 1" ) ; }