https://leetcode.com/problems/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. class Solution { public: string multiply(stri…
因为python具有无限精度的int类型,所以用python实现大整数乘法是没意义的,可是思想是一样的.利用的规律是:第一个数的第i位和第二个数大第j位相乘,一定累加到结果的第i+j位上,这里是从0位置開始算的.代码例如以下: import sys def list2str(li): while li[0]==0: del li[0] res='' for i in li: res+=str(i) return res def multi(stra,strb): aa=list(stra) bb…