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

deleted 178 characters in body
Source Link
lyxal
  • 35.6k
  • 2
  • 69
  • 148

Vyxal ,Vyxal r, 4 bytes

ΐ′′eΠẏǎeΠ

Try it Online! Try it Online!

ΐ′′eΠẏǎeΠ
ΐ # range(0, len(input))
 ′′ǎ # nth_prime(^) // vectorises
 e # ^ ** input // vectorises element-wise
 Π # product(^)

The r flag tells Vyxal to pass arguments to built-ins in reverse order. It's been around before this challenge, so I didn't add it to cheat this one time. Without it, this would be 5 bytes (ΐ′′$eΠ ẏǎ$eΠ)

Vyxal , r, 4 bytes

ΐ′′eΠ

Try it Online!

ΐ′′eΠ
ΐ # range(0, len(input))
 ′′ # nth_prime(^) // vectorises
 e # ^ ** input // vectorises element-wise
 Π # product(^)

The r flag tells Vyxal to pass arguments to built-ins in reverse order. It's been around before this challenge, so I didn't add it to cheat this one time. Without it, this would be 5 bytes (ΐ′′$eΠ)

Vyxal r, 4 bytes

ẏǎeΠ

Try it Online!

ẏǎeΠ
 # range(0, len(input))
 ǎ # nth_prime(^) // vectorises
 e # ^ ** input // vectorises element-wise
 Π # product(^)

The r flag tells Vyxal to pass arguments to built-ins in reverse order. It's been around before this challenge, so I didn't add it to cheat this one time. Without it, this would be 5 bytes (ẏǎ$eΠ)

Source Link
lyxal
  • 35.6k
  • 2
  • 69
  • 148

Vyxal, r, 4 bytes

ΐ′′eΠ

Try it Online!

ΐ′′eΠ
ΐ # range(0, len(input))
 ′′ # nth_prime(^) // vectorises
 e # ^ ** input // vectorises element-wise
 Π # product(^)

The r flag tells Vyxal to pass arguments to built-ins in reverse order. It's been around before this challenge, so I didn't add it to cheat this one time. Without it, this would be 5 bytes (ΐ′′$eΠ)

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