-6
\$\begingroup\$

Your task, is simply to multiply 2 integers given in input, separated by a ",". The catch is, you cannot use the multiplication operator "*", even if it is being used differently, or any loops whatsoever

This is code-golf, so shortest code wins!

Test cases: i dont know if you even need it! lol

1,0 -> 0

5,6 -> 30

3920,549 -> 2152080

\$\endgroup\$
3
0
\$\begingroup\$

05AB1E, 6 bytes

',¡`иO

Try it online or verify all test cases.

Would be 2 bytes without the restricted input-format:

иO

Try it online or verify all test cases.

Explanation:

',¡    '# Split the (implicit) input-string on ","
   `    # Pop and push both values separated to the stack
    и   # Repeat the first value the second value amount of times as list
     O  # Sum that list
        # (after which the result is output implicitly)
\$\endgroup\$
0
\$\begingroup\$

Python 3, 32 bytes

lambda x,y:eval("x"+chr(42)+"y")

Try it online!

\$\endgroup\$
3
  • \$\begingroup\$ no multiplication sign my friend \$\endgroup\$
    – DialFrost
    Jan 10 at 9:54
  • 1
    \$\begingroup\$ @DialFrost this is repeat, not multiply \$\endgroup\$
    – Fmbalbuena
    Jan 10 at 9:55
  • \$\begingroup\$ its still a sign, sry but u cannot use it whatsoever \$\endgroup\$
    – DialFrost
    Jan 10 at 9:56

Not the answer you're looking for? Browse other questions tagged or ask your own question.