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

Bounty Awarded with 100 reputation awarded by xnor
added 44 characters in body
Source Link
user202729
  • 17.6k
  • 2
  • 39
  • 71

JavaScript (Node.js), (削除) 43 (削除ここまで) (削除) 41 (削除ここまで) 37(削除) 37 (削除ここまで) 36 bytes

Thanks @Dennis Dennis for the idea of using string interpolation in this answer and save 4 bytes!

Thanks @ØrjanJohansen for -1!

a=>b=>eval(`0x${a}*0x${b}==0x$<0x${a*b}`)

Try it online! Try it online!

Take input as 2 numbers in currying syntax (a)(b)Of course when the destination base is less than the original base (string also workslike in my Jelly answer, because Javascriptthe base is very weakly typed2), and output true for easy, the false< for not easy to multiplymust be flipped.

JavaScript (Node.js), (削除) 43 (削除ここまで) (削除) 41 (削除ここまで) 37 bytes

Thanks @Dennis for the idea of using string interpolation in this answer and save 4 bytes!

a=>b=>eval(`0x${a}*0x${b}==0x${a*b}`)

Try it online!

Take input as 2 numbers in currying syntax (a)(b) (string also works, because Javascript is very weakly typed), and output true for easy, false for not easy to multiply.

JavaScript (Node.js), (削除) 43 (削除ここまで) (削除) 41 (削除ここまで) (削除) 37 (削除ここまで) 36 bytes

Thanks @Dennis for the idea of using string interpolation in this answer and save 4 bytes!

Thanks @ØrjanJohansen for -1!

a=>b=>eval(`0x${a}*0x${b}<0x${a*b}`)

Try it online!

Of course when the destination base is less than the original base (like in my Jelly answer, the base is 2) the < must be flipped.

added 344 characters in body
Source Link
user202729
  • 17.6k
  • 2
  • 39
  • 71

JavaScript (Node.js), (削除) 43 (削除ここまで) 41(削除) 41 (削除ここまで) 37 bytes

Thanks @Dennis for the idea of using string interpolation in this answer and save 4 bytes!

a=>b=>(g=n=>eval('0x'+n))a=>b=>eval(`0x${a)*g(}*0x${b)==g(}==0x${a*b}`)

Try it online! Try it online!

The algorithm should be correctTake input as 2 numbers in currying syntax (a)(b) (string also works, because Javascript is very weakly typed), and output true for easy, false for not easy to multiply.

JavaScript (Node.js), (削除) 43 (削除ここまで) 41 bytes

a=>b=>(g=n=>eval('0x'+n))(a)*g(b)==g(a*b)

Try it online!

The algorithm should be correct.

JavaScript (Node.js), (削除) 43 (削除ここまで) (削除) 41 (削除ここまで) 37 bytes

Thanks @Dennis for the idea of using string interpolation in this answer and save 4 bytes!

a=>b=>eval(`0x${a}*0x${b}==0x${a*b}`)

Try it online!

Take input as 2 numbers in currying syntax (a)(b) (string also works, because Javascript is very weakly typed), and output true for easy, false for not easy to multiply.

deleted 91 characters in body
Source Link
user202729
  • 17.6k
  • 2
  • 39
  • 71

JavaScript (Node.js), 43(削除) 43 (削除ここまで) 41 bytes

a=>b=>(g=n=>parseIntg=n=>eval(n,36'0x'+n))(a)*g(b)==g(a*b)

Try it online! Try it online!

I think thisThe algorithm should be correct. @LeakyNun ?

JavaScript (Node.js), 43 bytes

a=>b=>(g=n=>parseInt(n,36))(a)*g(b)==g(a*b)

Try it online!

I think this should be correct. @LeakyNun ?

JavaScript (Node.js), (削除) 43 (削除ここまで) 41 bytes

a=>b=>(g=n=>eval('0x'+n))(a)*g(b)==g(a*b)

Try it online!

The algorithm should be correct.

Source Link
user202729
  • 17.6k
  • 2
  • 39
  • 71
Loading

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