当前位置:网站首页>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))
边栏推荐
- 3、 High quality programming and performance tuning practical youth training camp notes
- 大视频文件的缓冲播放原理以及实现
- 微信小程序中的路由跳转
- Common method signatures and meanings of Iterable, collection and list
- Why should we understand the trend of spot gold?
- What is the interval in gatk4??
- Leetcode sword finger offer brush questions - day 20
- Idea add class annotation template and method template
- Is the test cycle compressed? Teach you 9 ways to deal with it
- [ANSYS] learning experience of APDL finite element analysis
猜你喜欢
![[ANSYS] learning experience of APDL finite element analysis](/img/bc/dc0742c308816553a80d50d1a990e3.jpg)
[ANSYS] learning experience of APDL finite element analysis
![[GUET-CTF2019]虚假的压缩包](/img/a2/7da2a789eb49fa0df256ab565d5f0e.png)
[GUET-CTF2019]虚假的压缩包

About some details of final, I have something to say - learn about final CSDN creation clock out from the memory model

leetcode:105. Constructing binary trees from preorder and inorder traversal sequences

Is the test cycle compressed? Teach you 9 ways to deal with it

Outsourcing for four years, abandoned

buuctf misc USB
![[2022 actf] Web Topic recurrence](/img/e4/ab9a1771489d751ee73a79f151d374.png)
[2022 actf] Web Topic recurrence

PHP exports millions of data

Jenkins远程构建项目超时的问题
随机推荐
[SUCTF 2019]Game
Outsourcing for four years, abandoned
基于Flask搭建个人网站
解决问题:Unable to connect to Redis
buuctf misc USB
Pytorch parameter initialization
Rxjs - observable doesn't complete when an error occurs - rxjs - observable doesn't complete when an error occurs
毕设-基于SSM大学生兼职平台系统
SQL优化的魅力!从 30248s 到 0.001s
Gslx680 touch screen driver source code analysis (gslx680. C)
MobaXterm
[OBS] win capture requires winrt
Why should we understand the trend of spot gold?
[GUET-CTF2019]虚假的压缩包
Simple example of ros2 planning system plansys2
Jenkins远程构建项目超时的问题
IO流 file
I failed in the postgraduate entrance examination and couldn't get into the big factory. I feel like it's over
Idea add class annotation template and method template
242. Bipartite graph determination