当前位置:网站首页>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))
边栏推荐
- Outsourcing for four years, abandoned
- 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
- 海思芯片(hi3516dv300)uboot镜像生成过程详解
- Operation suggestions for today's spot Silver
- Mysql高低版本切换需要修改的配置5-8(此处以aicode为例)
- Deep learning Flower Book + machine learning watermelon book electronic version I found
- Button wizard collection learning - mineral medicine collection and running map
- 《动手学深度学习》(四) -- 卷积神经网络 CNN
- Jenkins remote build project timeout problem
- [ANSYS] learning experience of APDL finite element analysis
猜你喜欢

为什么要了解现货黄金走势?

Operation suggestions for today's spot Silver

A bit of knowledge - about Apple Certified MFI

探索Cassandra的去中心化分布式架构

Interviewer: what development models do you know?

The metauniverse of the platofarm farm continues to expand, with Dao governance as the core

Why should we understand the trend of spot gold?

nacos

Write CPU yourself -- Chapter 9 -- learning notes
![[2022 CISCN]初赛 web题目复现](/img/1c/4297379fccde28f76ebe04d085c5a4.png)
[2022 CISCN]初赛 web题目复现
随机推荐
电商常规问题part1
1141_ SiCp learning notes_ Functions abstracted as black boxes
【斯坦福计网CS144项目】Lab3: TCPSender
Tianqing sends instructions to bypass the secondary verification
C语言航班订票系统
What is the difference between TCP and UDP?
nacos
Flutter riverpod is comprehensively and deeply analyzed. Why is it officially recommended?
【webrtc】m98 screen和window采集
vus. Precautions for SSR requesting data in asyndata function
Regular e-commerce problems part1
即刻报名|飞桨黑客马拉松第三期等你挑战
Redis data migration
解决could not find or load the Qt platform plugin “xcb“in ““.
Invalid table alias or column reference`xxx`
【斯坦福计网CS144项目】Lab4: TCPConnection
图解GPT3的工作原理
Leetcode-206. Reverse Linked List
[2022 actf] Web Topic recurrence
在线直播系统源码,使用ValueAnimator实现view放大缩小动画效果