Grasshopper

algorithmic modeling for Rhino

Well friends, you can have fun and win 1M dollars (plus the girl and some grams of caviar) with this one:

just mastermind the fasted method to "merge" these Lists.

Of course as the challenge initiator I can't participate (but I provide some "hints" for the brave). In the mean time that caviar is rather delicious. 

PS: Add your method to the script in order to consolidate things.

best, Peter The Troll, District 9, North Pole

Views: 336

Attachments:

Replies to This Discussion

Not sure about the speed, the values are all so short and variable that it's hard to figure out. But this is certainly the cleanest way in my book:

L3 = new List<int>(L1.Count + L2.Count);
L3.AddRange(L1);
L3.AddRange(L2);

Update:

Good news: David provided not only the coolest but also the fastest method (yet)

Bad news: I've consumed the caviar (was delicious), the girl refuses to be part of the prize (preposterous) and finally due to a typo the prize is 1m not 1M (m for micron).

My lawyer will contact your lawyer forthwith.

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service