当前位置:网站首页>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))
边栏推荐
- Technology cloud report: from robot to Cobot, human-computer integration is creating an era
- Operation suggestions for today's spot Silver
- After the interview, the interviewer roast in the circle of friends
- Make a bat file for cleaning system garbage
- 通信设备商,到底有哪些岗位?
- 按键精灵脚本学习-关于天猫抢红包
- php导出百万数据
- Leetcode-226. Invert Binary Tree
- Pytest + allure + Jenkins Environment - - achèvement du remplissage de la fosse
- 1140_ SiCp learning notes_ Use Newton's method to solve the square root
猜你喜欢
![[mathematical notes] radian](/img/43/2af510adb24fe46fc0033d11d60488.jpg)
[mathematical notes] radian

【Unity】物体做圆周运动的几个思路
![[SUCTF 2019]Game](/img/9c/362117a4bf3a1435ececa288112dfc.png)
[SUCTF 2019]Game

Mutual conversion between InputStream, int, shot, long and byte arrays

Leetcode-226. Invert Binary Tree

resource 创建包方式

leetcode:105. 从前序与中序遍历序列构造二叉树

Sign up now | oar hacker marathon phase III, waiting for your challenge

The configuration that needs to be modified when switching between high and low versions of MySQL 5-8 (take aicode as an example here)

@component(““)
随机推荐
Idea add class annotation template and method template
../ And/
探索Cassandra的去中心化分布式架构
pytest+allure+jenkins環境--填坑完畢
CentOS7下安装PostgreSQL11数据库
Button wizard collection learning - mineral medicine collection and running map
After 95, Alibaba P7 published the payroll: it's really fragrant to make up this
Wx is used in wechat applet Showtoast() for interface interaction
SQL优化的魅力!从 30248s 到 0.001s
Mysql高低版本切换需要修改的配置5-8(此处以aicode为例)
基于Flask搭建个人网站
在线直播系统源码,使用ValueAnimator实现view放大缩小动画效果
Tianqing sends instructions to bypass the secondary verification
【数学笔记】弧度
3、 High quality programming and performance tuning practical youth training camp notes
【p2p】本地抓包
[guess-ctf2019] fake compressed packets
leetcode:105. 从前序与中序遍历序列构造二叉树
Write CPU yourself -- Chapter 9 -- learning notes
Sign up now | oar hacker marathon phase III, waiting for your challenge