I am having an error in my code below and cant figure out why. It must be some stupid smalle error. After doing a lot of testing, I have conluded that the first time through goes fine. But when it loops through a subsequent times it automatically returns 0, though the if statement is not true. Any idea what is wrong here?
setCardinality returns the size of the array.
setCardinality returns the size of the array.