Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Answer

added 156 characters in body
Source Link
Luis Mendo
  • 106.7k
  • 10
  • 139
  • 382

Python 3, (削除) 49 (削除ここまで) 46(削除) 46 (削除ここまで) 45 bytes

3 bytes removed thanks to @Mr.Xcoder (splat instead of two arguments), and 1 byte thanks to @ovs (map instead of list comprehension)

lambda*x:[a*map(lambda a,b:a*(a>=b)+b*(b>=a)for a,b in zip(*x)]

Try it online! Try it online!

Python 3, (削除) 49 (削除ここまで) 46 bytes

3 bytes removed thanks to @Mr.Xcoder

lambda*x:[a*(a>=b)+b*(b>=a)for a,b in zip(*x)]

Try it online!

Python 3, (削除) 49 (削除ここまで) (削除) 46 (削除ここまで) 45 bytes

3 bytes removed thanks to @Mr.Xcoder (splat instead of two arguments), and 1 byte thanks to @ovs (map instead of list comprehension)

lambda*x:map(lambda a,b:a*(a>=b)+b*(b>=a),*x)

Try it online!

added 50 characters in body
Source Link
Luis Mendo
  • 106.7k
  • 10
  • 139
  • 382

Python 3, 49(削除) 49 (削除ここまで) 46 bytes

3 bytes removed thanks to @Mr.Xcoder

lambda x,ylambda*x:[a*(a>=b)+b*(b>=a)for a,b in zip(x,y*x)]

Try it online! Try it online!

Python 3, 49 bytes

lambda x,y:[a*(a>=b)+b*(b>=a)for a,b in zip(x,y)]

Try it online!

Python 3, (削除) 49 (削除ここまで) 46 bytes

3 bytes removed thanks to @Mr.Xcoder

lambda*x:[a*(a>=b)+b*(b>=a)for a,b in zip(*x)]

Try it online!

Source Link
Luis Mendo
  • 106.7k
  • 10
  • 139
  • 382

Python 3, 49 bytes

lambda x,y:[a*(a>=b)+b*(b>=a)for a,b in zip(x,y)]

Try it online!

AltStyle によって変換されたページ (->オリジナル) /