Java.math.BigInteger can easily solve this question

  • -20

    import java.math.BigInteger;

    public String multiply(String num1, String num2) {
    	BigInteger b1 = new BigInteger(num1);
    	BigInteger b2 = new BigInteger(num2);
    	 return b1.multiply(b2).toString();

  • 0

    This kind of solution will receive lots of negative votes by leetcoders absolutely...

Log in to reply

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.