当前位置:网站首页>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))
边栏推荐
- Leetcode-543. Diameter of Binary Tree
- What is the difference between TCP and UDP?
- Robot technology innovation and practice old version outline
- Determining the full type of a variable
- 基于Flask搭建个人网站
- C语言航班订票系统
- [2022 ACTF]web题目复现
- Jenkins remote build project timeout problem
- MobaXterm
- Pytest+allure+jenkins environment -- completion of pit filling
猜你喜欢

自定义类加载器加载网络Class

Robot technology innovation and practice old version outline
![[experience sharing] how to expand the cloud service icon for Visio](/img/42/dba9f78f3fb2049dad8b343b0b36e5.png)
[experience sharing] how to expand the cloud service icon for Visio

buuctf misc USB

2022-07-06: will the following go language codes be panic? A: Meeting; B: No. package main import “C“ func main() { var ch chan struct

Few-Shot Learning && Meta Learning:小样本学习原理和Siamese网络结构(一)
![[2022 ACTF]web题目复现](/img/e4/ab9a1771489d751ee73a79f151d374.png)
[2022 ACTF]web题目复现

php导出百万数据

Why should we understand the trend of spot gold?

@component(““)
随机推荐
Jenkins remote build project timeout problem
numpy中dot函数使用与解析
Use and analysis of dot function in numpy
【Unity】物体做圆周运动的几个思路
What are the positions of communication equipment manufacturers?
buuctf misc USB
Solve could not find or load the QT platform plugin "xcb" in "
【p2p】本地抓包
Bi she - college student part-time platform system based on SSM
242. Bipartite graph determination
【obs】win-capture需要winrt
解决could not find or load the Qt platform plugin “xcb“in ““.
[experience sharing] how to expand the cloud service icon for Visio
misc ez_ usb
Why should we understand the trend of spot gold?
pytest+allure+jenkins環境--填坑完畢
Sign up now | oar hacker marathon phase III, waiting for your challenge
gatk4中的interval是什么??
Six methods of flattening arrays with JS
Leetcode-543. Diameter of Binary Tree