|
Re: duplicate numbers in arrays
I made a boo-boo:
Quote:
|
Originally Posted by lectricpharaoh
if(isValueInArray(n, list, idx) { list[idx] = n; ++idx; }
|
You need to invert that condition, and I missed a parenthesis: if(!isValueInArray(n, list, idx))
{
list[idx] = n;
++idx;
}
__________________
And once again, Probability proves itself willing to sneak into a back alley and service Drama as would a copper-piece harlot.
- Vaarsuvius, Order of the Stick
|