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 471 characters in body
Source Link
Razetime
  • 27.6k
  • 3
  • 31
  • 77

Ruby, (削除) 44 (削除ここまで) 40 bytes

->a,b{a.to_s.chars.rotate(-b).join.to_i}

-4 from Dingus.

Try it online!

Ruby , 19 bytes

->a,b{a.rotate(-b)}

Try it online!

taking a list of digits

Ruby, (削除) 44 (削除ここまで) 40 bytes

->a,b{a.to_s.chars.rotate(-b).join.to_i}

-4 from Dingus.

Try it online!

Ruby, (削除) 44 (削除ここまで) 40 bytes

->a,b{a.to_s.chars.rotate(-b).join.to_i}

-4 from Dingus.

Try it online!

Ruby , 19 bytes

->a,b{a.rotate(-b)}

Try it online!

taking a list of digits

added 19 characters in body
Source Link
Razetime
  • 27.6k
  • 3
  • 31
  • 77

Ruby, 44(削除) 44 (削除ここまで) 40 bytes

->a,b{a.to_s.split(//)chars.rotate(-b).join.to_i}

Try it online! -4 from Dingus.

Try it online!

Ruby, 44 bytes

->a,b{a.to_s.split(//).rotate(-b).join.to_i}

Try it online!

Ruby, (削除) 44 (削除ここまで) 40 bytes

->a,b{a.to_s.chars.rotate(-b).join.to_i}

-4 from Dingus.

Try it online!

Source Link
Razetime
  • 27.6k
  • 3
  • 31
  • 77

Ruby, 44 bytes

->a,b{a.to_s.split(//).rotate(-b).join.to_i}

Try it online!

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