I’m coming back to programming after years off and am having trouble wrapping my head around this problem. The user is defining the Classification set amount but the RasterValue is list is of length N
Example:
ClassificationSet = (1, 2, 3, 4, 5, 6) #defined by user
RasterVal = () #length = N
I store items into RasterVal using ClassificationSet as an index:
RasterVal(ClassificationSet).add(Imported Value)
RasterVal(1) = 22,23,24,25,23,23,22
RasterVal(2) = 22,30,31,32,30,30
RasterVal(3) = 31
which is: RasterVal([],[22,23,24,25,23,23,22], [22,30,31,32,30,30], [31])
I want to list values that are repeated but only if they are repeated in different sets, not the same one.
Output should be:
RepeatSet = 22, 31
Thank you very much for any help. I’ve been able to compare the sets but it lists repeated values even if they appear in the same set list.
@lukecampbell is right:
The runtime of this algorithm is linear, rather than quadratic in the number of sets.