Skip to main content
2 of 3
Improve title
Carl Woll
  • 131.7k
  • 6
  • 246
  • 359

Finding element-wise Max of two lists

I need a compare-operation for two lists of same length (usually > 100000) which does the following:

{2,3,5,4,1,8,7} compare-operation {1,4,6,3,2,8,8} = {2,4,6,4,2,8,8}

The resulting list has at each position the greater (or equal element in case both are equal) of the two lists (because 2>1,4>3,6>5,4>3,2>1,8=8,8>7).

How can that be done?

Thanks in advance, Milenko

mrz
  • 11.8k
  • 2
  • 26
  • 85