当前位置:网站首页>Leetcode 43 String multiplication (2022.02.12)
Leetcode 43 String multiplication (2022.02.12)
2022-07-07 07:49:00 【ChaoYue_ miku】
Given two non negative integers in the form of strings num1 and num2, return num1 and num2 The product of the , Their product is also represented as a string .
Be careful : You cannot use any built-in BigInteger Library or directly convert the input to an integer .
Example 1:
Input : num1 = “2”, num2 = “3”
Output : “6”
Example 2:
Input : num1 = “123”, num2 = “456”
Output : “56088”
Tips :
1 <= num1.length, num2.length <= 200
num1 and num2 It can only consist of numbers .
num1 and num2 It doesn't contain any leading zeros , In addition to digital 0 In itself .
source : Power button (LeetCode)
link :https://leetcode-cn.com/problems/multiply-strings
Method 1 : Call the type conversion function
Python3 Submission :
class Solution:
def multiply(self, num1: str, num2: str) -> str:
return str(int(num1) * int(num2))
边栏推荐
- Pytorch parameter initialization
- 自定义类加载器加载网络Class
- PHP exports millions of data
- Rust Versus Go(哪种是我的首选语言?)
- Six methods of flattening arrays with JS
- Build personal website based on flask
- Leetcode sword finger offer brush questions - day 20
- gatk4中的interval是什么??
- [SUCTF 2019]Game
- JSON introduction and JS parsing JSON
猜你喜欢

resource 创建包方式

Jenkins remote build project timeout problem

1140_ SiCp learning notes_ Use Newton's method to solve the square root

buuctf misc USB

JSON introduction and JS parsing JSON

IO stream file
![[UTCTF2020]file header](/img/e3/818e2d531a06ab90de189055f634ad.png)
[UTCTF2020]file header

【斯坦福计网CS144项目】Lab3: TCPSender
![[unity] several ideas about circular motion of objects](/img/84/e70c6696629dbe17ace011553f43ff.png)
[unity] several ideas about circular motion of objects
![[webrtc] m98 Screen and Window Collection](/img/b1/1ca13b6d3fdbf18ff5205ed5584eef.png)
[webrtc] m98 Screen and Window Collection
随机推荐
Is the test cycle compressed? Teach you 9 ways to deal with it
基于Flask搭建个人网站
Sign up now | oar hacker marathon phase III, waiting for your challenge
【obs】win-capture需要winrt
图解GPT3的工作原理
misc ez_ usb
nacos
PHP exports millions of data
科技云报道:从Robot到Cobot,人机共融正在开创一个时代
Resource create package method
Pytest+allure+jenkins installation problem: pytest: error: unrecognized arguments: --alluredir
JSON introduction and JS parsing JSON
Operation suggestions for today's spot Silver
Rxjs - observable doesn't complete when an error occurs - rxjs - observable doesn't complete when an error occurs
IPv4 exercises
Make a bat file for cleaning system garbage
Pytest+allure+jenkins environment -- completion of pit filling
resource 创建包方式
Codeforces Global Round 19
大视频文件的缓冲播放原理以及实现