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 11 characters in body
Source Link
G B
  • 23.4k
  • 1
  • 24
  • 55

Ruby, 7169 bytes

->a,b{(0..a+ba+b=~/$/).all?{|r|(0..r).sum{|w|a/10**w%10*(b/10**(r|w|a[w].to_i*b[r-w)%10)w].to_i}<10}}

Try it online! Try it online!

Ruby, 71 bytes

->a,b{(0..a+b).all?{|r|(0..r).sum{|w|a/10**w%10*(b/10**(r-w)%10)}<10}}

Try it online!

Ruby, 69 bytes

->a,b{(0..a+b=~/$/).all?{|r|(0..r).sum{|w|a[w].to_i*b[r-w].to_i}<10}}

Try it online!

Source Link
G B
  • 23.4k
  • 1
  • 24
  • 55

Ruby, 71 bytes

 ->a,b{(0..a+b).all?{|r|(0..r).sum{|w|a/10**w%10*(b/10**(r-w)%10)}<10}}

Try it online!

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