当前位置:网站首页>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))
边栏推荐
- 解决问题:Unable to connect to Redis
- Detailed explanation of uboot image generation process of Hisilicon chip (hi3516dv300)
- Live online system source code, using valueanimator to achieve view zoom in and out animation effect
- [Stanford Jiwang cs144 project] lab4: tcpconnection
- Use and analysis of dot function in numpy
- 解决could not find or load the Qt platform plugin “xcb“in ““.
- Info | webrtc M97 update
- nacos
- IPv4 exercises
- JS get all date or time stamps between two time stamps
猜你喜欢
[GUET-CTF2019]虚假的压缩包
Detailed explanation of uboot image generation process of Hisilicon chip (hi3516dv300)
Asemi rectifier bridge rs210 parameters, rs210 specifications, rs210 package
[2022 CISCN]初赛 web题目复现
SQL优化的魅力!从 30248s 到 0.001s
Robot technology innovation and practice old version outline
[P2P] local packet capturing
3、 High quality programming and performance tuning practical youth training camp notes
[2022 ciscn] replay of preliminary web topics
Flutter riverpod is comprehensively and deeply analyzed. Why is it officially recommended?
随机推荐
nacos
Route jump in wechat applet
Hands on deep learning (IV) -- convolutional neural network CNN
misc ez_ usb
JS get all date or time stamps between two time stamps
What are the positions of communication equipment manufacturers?
Weibo publishing cases
[Stanford Jiwang cs144 project] lab4: tcpconnection
Outsourcing for four years, abandoned
Invalid table alias or column reference`xxx`
【经验分享】如何为visio扩展云服务图标
What is the difference between TCP and UDP?
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
1141_ SiCp learning notes_ Functions abstracted as black boxes
numpy中dot函数使用与解析
Build personal website based on flask
解决问题:Unable to connect to Redis
A concurrent rule verification implementation
直播平台源码,可折叠式菜单栏
微博发布案例