Module Expr Str Assign NameStore Str ClassDef bases NameLoad body FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore ListLoad If CompareLt Call NameLoad NameLoad Call NameLoad NameLoad body Assign TupleStore NameStore NameStore TupleLoad NameLoad NameLoad Assign NameStore SubscriptLoad NameLoad Slice Num Assign NameStore SubscriptLoad NameLoad Slice Num For NameStore Call NameLoad Call NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad Call AttributeLoad Str attr GeneratorExp Call NameLoad NameLoad comprehension NameStore NameLoad attr Str If UnaryOpNot NameLoad body Return Str Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad NameLoad Assign NameStore ListComp Call NameLoad NameLoad comprehension NameStore NameLoad Assign NameStore Num For NameStore Call NameLoad Call NameLoad NameLoad body Assign NameStore SubscriptLoad NameLoad Index NameLoad Assign NameStore BinOpAdd BinOpMult NameLoad NameLoad NameLoad Assign NameStore BinOpDiv NameLoad Num Assign NameStore BinOpMod NameLoad Num Assign SubscriptStore NameLoad Index NameLoad NameLoad If CompareNotEq NameLoad Num body Expr Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Num Assign NameStore ListLoad Num For TupleStore NameStore NameStore Call NameLoad NameLoad body For NameStore Call NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr Num Num Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad AugAssignAdd NameStore Num Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad NameLoad Assign NameStore Call NameLoad NameLoad If CompareLt Call NameLoad NameLoad Call NameLoad NameLoad body Assign TupleStore NameStore NameStore TupleLoad NameLoad NameLoad Assign NameStore Num For NameStore Call NameLoad Call NameLoad NameLoad body TryExcept body Assign NameStore BinOpAdd BinOpAdd SubscriptLoad NameLoad Index NameLoad SubscriptLoad NameLoad Index NameLoad NameLoad handlers ExceptHandler type NameLoad body Assign NameStore BinOpAdd SubscriptLoad NameLoad Index NameLoad NameLoad If CompareEq NameLoad SubscriptLoad NameLoad Index NameLoad body Break Assign NameStore BinOpDiv NameLoad Num Assign SubscriptStore NameLoad Index NameLoad BinOpMod NameLoad Num If CompareNotEq NameLoad Num body Expr Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list decorator_list If CompareEq NameLoad Str body Assign NameStore Call NameLoad Assert CompareEq ListLoad Num Num Call AttributeLoad NameLoad attr ListLoad Num Num ListLoad Num Assert CompareEq ListLoad Num Num Num Num Call AttributeLoad NameLoad attr Str Str Assert CompareEq Call NameLoad BinOpMult Num Num Call AttributeLoad NameLoad attr Str Str Assert CompareEq Call NameLoad Num Call AttributeLoad NameLoad attr Str Str Assert CompareEq Call NameLoad BinOpMult Num Num Call AttributeLoad NameLoad attr Str Str
N/A N/A 
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.
 N/A __author__ Danyang Solution N/A object N/A multiply N/A N/A self num1 num2 N/A N/A N/A 
        Google Phone Interview Question, 20 Sep 2013
        Steps:
        * multiply by 1 digit at a time
        * add the temporary results up

        To make the processing easier:
        * order the two numbers
        * reverse the numbers

        Solved around 1 hour

        :param num1: String
        :param num2: String
        :return: String
         N/A result N/A N/A N/A N/A len num1 N/A len num2 N/A N/A N/A num1 num2 N/A num2 num1 N/A num2 N/A num2 N/A -1 N/A num1 N/A num1 N/A -1 N/A i N/A range N/A len num2 N/A N/A N/A N/A result append N/A N/A self multiply_1_digit N/A num2 N/A i num1 N/A lst N/A N/A self add_list result N/A N/A N/A lst reverse N/A result N/A N/A N/A N/A join N/A N/A str item N/A item lst lstrip 0 N/A N/A result N/A N/A 0 N/A result N/A multiply_1_digit N/A N/A self digit num N/A N/A N/A 
        :param digit: String
        :param num: String
        :return: list of digit in reverse order
         N/A digit N/A int digit N/A temp N/A N/A int item N/A item num N/A carry 0 N/A ind N/A range N/A len temp N/A N/A val N/A temp N/A ind N/A mul N/A N/A val digit carry N/A carry N/A mul 10 N/A mul N/A mul 10 N/A N/A temp N/A ind mul N/A N/A carry 0 N/A N/A N/A N/A temp append carry N/A temp N/A add_list N/A N/A self lst N/A N/A N/A 
        add lst of string
        :param lst:
        :return:
         N/A appending_zero 0 N/A result N/A 0 N/A N/A ind val N/A enumerate lst N/A N/A i N/A range appending_zero N/A N/A N/A N/A val insert 0 0 N/A result N/A N/A self add result val N/A appending_zero 1 N/A result N/A add N/A N/A self num1 num2 N/A N/A N/A 
        :param num1: list of digits in reverse order
        :param num2: list of digits in reverse order
        :return: list of digits in reverse order
         N/A num1 N/A list num1 N/A num2 N/A list num2 N/A N/A N/A len num1 N/A len num2 N/A N/A N/A num1 num2 N/A num2 num1 N/A carry 0 N/A ind N/A range N/A len num1 N/A N/A N/A N/A result N/A N/A N/A num1 N/A ind N/A num2 N/A ind carry N/A N/A N/A IndexError N/A N/A result N/A N/A num1 N/A ind carry N/A N/A result N/A num1 N/A ind N/A N/A N/A carry N/A result 10 N/A N/A num1 N/A ind N/A result 10 N/A N/A carry 0 N/A N/A N/A N/A num1 append carry N/A num1 N/A N/A N/A N/A __name__ __main__ N/A N/A solution N/A Solution N/A N/A N/A 1 2 N/A N/A solution add N/A 2 1 N/A 9 N/A N/A N/A 1 9 9 8 N/A N/A solution multiply_1_digit 9 999 N/A N/A N/A str N/A 123 999 N/A N/A solution multiply 123 999 N/A N/A N/A str 0 N/A N/A solution multiply 0 0 N/A N/A N/A str N/A 123 456 N/A N/A solution multiply 123 456