# LeetCode Multiply Strings: Simulation of Add and Multiplication

## Overview

LeetCode Multiply Strings: the challeng is that the value could be arbitrary large, so we have to simulate Add and Multiplication character by character.

## LeetCode Multiply Strings

Given two numbers represented as strings, return multiplication of the numbers as a string.

Note: The numbers can be arbitrarily large and are non-negative.

## Solution and Precautions: Simulation of Add and Multiplication

The algorithm is not difficult, just a simulation of the way we do multiplication, we need exact each single character out and do the multiplication on step by one step. Just be careful when dealing with the carry and the zero result. Several special cases worth noting:

999 * 0 = 0

501 * 6 = 3006

The following Java code is accepted by LeetCode OJ to pass this Multiply Strings problem:

## Summary

LeetCode Multiply Strings: the challeng is that the value could be arbitrary large, so we have to simulate Add and Multiplication character by character.

Written on May 20, 2013