Cody

Problem 42636. Big Integer Multiplication

Implement big integer multiply.

Input:

A, B : N-by-M Matrix, each row represents a positive decimal integer.

Output:

C : N-by-P Matrix, each row represents the decimal integer A*B.

Example 1:

a = [1 2 3;0 5 6];
b = [5 6;9 0];
c = BigIntMult(a,b)
c =
   6     8     8     8
   5     0     4     0

123*56=6888 (c(1,:)), 56*90=5040 (c(2,:))

Example 2 (singleton expansion):

a = [1 2 3;0 5 6];
b = [5 7];
c = BigIntMult(a,b)
c =
   7     0     1     1
   3     1     9     2

123*57=7011 (c(1,:)), 56*57=3192 (c(2,:))

Note:

1.you don't need to remove the leading zeroes.

2.your score will depend on your solution performance.

Solution Stats

42.28% Correct | 57.72% Incorrect
Last Solution submitted on Jun 11, 2018

Problem Comments

Problem Recent Solvers6

Suggested Problems

More from this Author8