Let’s say I have five integer values that must all be unique.
int a;
int b;
int c;
int d;
int e;
Obviously I could do something like this to test for that:
if (a == b) {
return false;
} else if (a == c) {
return false;
} else if (a == d) {
return false;
}
//etc etc
But that makes for extremely messy code in my opinion. Is there a “cleaner” way to do this?
Probably a bit of overhead, but you could do: