Skip to main content
Post Undeleted by Laikoni
added 385 characters in body
Source Link
Laikoni
  • 26.3k
  • 6
  • 52
  • 115

Haskell, 3535 41 bytes

a#b|all(`elem`[1`elem`[0..99])[a,b,a*b]=a*bb]=mod(a*b)$1+99

Try it online!Try it online!

Example usage: 3#4 returns 12, while fake numbers like 3.5#4, 3#400300#4 and 3#40(-3)#4 all yield the error non-exhaustive pattern in function #. Non-fake inputs whose product would be greater than 99 result in the product modulus 100.

Edit: Thanks to Jonathan Allan for pointing out that I initially missed a part of the challenge.

Haskell, 35 bytes

a#b|all(`elem`[1..99])[a,b,a*b]=a*b

Try it online! Example usage: 3#4 returns 12, while 3.5#4, 3#400 and 3#40 all yield the error non-exhaustive pattern in function #.

Haskell, 35 41 bytes

a#b|all(`elem`[0..99])[a,b]=mod(a*b)$1+99

Try it online!

Example usage: 3#4 returns 12, while fake numbers like 3.5#4, 300#4 and (-3)#4 all yield the error non-exhaustive pattern in function #. Non-fake inputs whose product would be greater than 99 result in the product modulus 100.

Edit: Thanks to Jonathan Allan for pointing out that I initially missed a part of the challenge.

Post Deleted by Laikoni
Source Link
Laikoni
  • 26.3k
  • 6
  • 52
  • 115

Haskell, 35 bytes

a#b|all(`elem`[1..99])[a,b,a*b]=a*b

Try it online! Example usage: 3#4 returns 12, while 3.5#4, 3#400 and 3#40 all yield the error non-exhaustive pattern in function #.