Skip to content

Instantly share code, notes, and snippets.

@JeffersonCarvalh0
Created April 15, 2020 15:13
Show Gist options
  • Save JeffersonCarvalh0/34dd86680c662bde9a6c47636435fd17 to your computer and use it in GitHub Desktop.
Save JeffersonCarvalh0/34dd86680c662bde9a6c47636435fd17 to your computer and use it in GitHub Desktop.
bool duplicate = false;
for ( int i = 0; i < n; ++i ) {
for ( int j = 0; j < n; ++j ) {
if ( i != j && A[ i ] == A[ j ] ) {
duplicate = true;
break;
}
}
if ( duplicate ) {
break;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment