Hi,
In the context of the ICE modeling challenge I came up with a small compound to get the intersection of 2 integer arrays, for example [1,5,7,9] and [2,4,5,7,12] will give [5,7].
You can see the ICE Tree for it in this thread. (Moderator edit - ...or below - HB)
Just beware it will build arrays of the size of the maximum integer value, so might not be the best choice if you want to intersect arrays like [ 12323, 2350924 ]
Claude
Moderator edit: I've hidden the URL behind "this thread" and added a direct [img] link to the image... - HB
Integer Array Intersection Compound
- claudevervoort
- Posts: 89
- Joined: 16 Oct 2009, 02:56
- Location: Montréal, QC, Canada
- Contact:
- Hirazi Blue
- Administrator
- Posts: 5107
- Joined: 04 Jun 2009, 12:15
Re: Integer Array Intersection Compound
Like I already said in the other thread: very nice compound.
Not only for its intended use, but also to show an approach to the problem
I personally wouldn't have thought of in - oh lets say - a million years.
Great compound & very educational: A+ ;)
Not only for its intended use, but also to show an approach to the problem
I personally wouldn't have thought of in - oh lets say - a million years.
Great compound & very educational: A+ ;)
Stay safe, sane & healthy!
Who is online
Users browsing this forum: No registered users and 69 guests