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 9 characters in body
Source Link
ovs
  • 61.2k
  • 3
  • 49
  • 164

Python 2 Python 3, 53(削除) 53 (削除ここまで) 52 bytes

f=lambda x,n,i=0:x[i:]and n**0**n**(i%ni%n<1)*x[i]+f(x,n,i+1)

Try it online! Try it online!

Python 2, 53 bytes

f=lambda x,n,i=0:x[i:]and n**0**(i%n)*x[i]+f(x,n,i+1)

Try it online!

Python 3, (削除) 53 (削除ここまで) 52 bytes

f=lambda x,n,i=0:x[i:]and n**(i%n<1)*x[i]+f(x,n,i+1)

Try it online!

Source Link
ovs
  • 61.2k
  • 3
  • 49
  • 164

Python 2, 53 bytes

f=lambda x,n,i=0:x[i:]and n**0**(i%n)*x[i]+f(x,n,i+1)

Try it online!

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