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 91 characters in body
Source Link
Emigna
  • 53.2k
  • 5
  • 44
  • 164

05AB1E, (削除) 9 (削除ここまで) 8(削除) 8 (削除ここまで) 7 bytes

Saved a byte as Erik the Outgolfer pointed out that a list of lists is valid input.

‚øεMsËi·øεMsËi·

Try it online!

Explanation

‚øø # zip the lists
 ε # apply to each pair
 M # get max
 s # swap the top 2 elements on the stack
 Ëi # if all elements are equal
 · # double the max

05AB1E, (削除) 9 (削除ここまで) 8 bytes

‚øεMsËi·

Try it online!

Explanation

‚ø # zip the lists
 ε # apply to each pair
 M # get max
 s # swap the top 2 elements on the stack
 Ëi # if all elements are equal
 · # double the max

05AB1E, (削除) 9 (削除ここまで) (削除) 8 (削除ここまで) 7 bytes

Saved a byte as Erik the Outgolfer pointed out that a list of lists is valid input.

øεMsËi·

Try it online!

Explanation

ø # zip the lists
 ε # apply to each pair
 M # get max
 s # swap the top 2 elements on the stack
 Ëi # if all elements are equal
 · # double the max
added 27 characters in body
Source Link
Emigna
  • 53.2k
  • 5
  • 44
  • 164

05AB1E, 9(削除) 9 (削除ここまで) 8 bytes

‚øεDËiOëM‚øεMsËi·

Try it online! Try it online!

Explanation

‚ø # zip the lists
 ε # apply to each pair
 DM # duplicateget max
 Ëis  # ifswap allthe elementstop in2 theelements pairon arethe equalstack
 OËi # sum
  ë if all elements #are elseequal
 · M # takedouble the max

05AB1E, 9 bytes

‚øεDËiOëM

Try it online!

Explanation

‚ø # zip the lists
 ε # apply to each pair
 D # duplicate
 Ëi # if all elements in the pair are equal
 O # sum
  ë  # else
 M # take max

05AB1E, (削除) 9 (削除ここまで) 8 bytes

‚øεMsËi·

Try it online!

Explanation

‚ø # zip the lists
 ε # apply to each pair
 M # get max
 s  # swap the top 2 elements on the stack
 Ëi # if all elements are equal
 · # double the max
Source Link
Emigna
  • 53.2k
  • 5
  • 44
  • 164

05AB1E, 9 bytes

‚øεDËiOëM

Try it online!

Explanation

‚ø # zip the lists
 ε # apply to each pair
 D # duplicate
 Ëi # if all elements in the pair are equal
 O # sum
 ë # else
 M # take max

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