C
Chris
Not in the right group I know, but it's the only one I visit and someone
here probably knows.
I have an array of integers 1 to X.
It is not sorted and already populated.
If there are 5 elements then 1,2,3,4,5 would have to be in the array
The user could screw up and enter 2,2,3,4,5 this would be wrong.
Is there a way to check if I have a valid array without looping twice?
We couldn't figure it out but I figured there was a way, so I asked people
smarter than me.
Thanks
Chris
here probably knows.
I have an array of integers 1 to X.
It is not sorted and already populated.
If there are 5 elements then 1,2,3,4,5 would have to be in the array
The user could screw up and enter 2,2,3,4,5 this would be wrong.
Is there a way to check if I have a valid array without looping twice?
We couldn't figure it out but I figured there was a way, so I asked people
smarter than me.
Thanks
Chris