Learn
Practice
Interview
Resources
Newsletter
F
Toggle theme
0
F
0
Toggle menu
Animations
← Back to All Animations
43. Multiply Strings
Bookmark
Input
Standard
Simple
With Zero
Custom
num1
=
123
,
num2
=
456
num1
1
2
3
×
num2
4
5
6
products
0
1
2
3
4
5
0
0
0
0
0
0
digit i × digit j lands in slot i + j + 1
num1
1
2
3
×
num2
4
5
6
products
0
1
2
3
4
5
0
0
0
0
0
0
digit i × digit j lands in slot i + j + 1
num1
1
2
3
i
×
num2
4
5
6
j
products
0
1
2
3
4
5
0
0
0
0
0
18
i+j+1
3 × 5 =
15
→ slot 2+1+1 = 4
num1
1
2
3
i
×
num2
4
5
6
j
products
0
1
2
3
4
5
0
0
0
12
15
18
i+j+1
2 × 6 =
12
→ slot 1+2+1 = 4
num1
1
2
3
i
×
num2
4
5
6
j
products
0
1
2
3
4
5
0
0
0
22
27
18
i+j+1
+10
products[3] = 12 + 10 =
22
num1
1
2
3
i
×
num2
4
5
6
j
products
0
1
2
3
4
5
0
0
8
22
27
18
i+j+1
1 × 6 =
6
→ slot 0+2+1 = 3
num1
1
2
3
i
×
num2
4
5
6
j
products
0
1
2
3
4
5
0
0
13
28
27
18
i+j+1
1 × 4 =
4
→ slot 0+0+1 = 1
num1
1
2
3
×
num2
4
5
6
products
0
1
2
3
4
5
0
4
13
28
27
18
k
18 → keep
8
, carry
1
left
num1
1
2
3
×
num2
4
5
6
products
0
1
2
3
4
5
0
4
13
30
8
8
k
+2
products[4] = 8, products[3] =
30
num1
1
2
3
×
num2
4
5
6
products
0
1
2
3
4
5
0
5
6
0
8
8
k
+1
products[2] = 6, products[1] =
5
num1
1
2
3
×
num2
4
5
6
products
0
1
2
3
4
5
0
5
6
0
8
8
drop leading zeros →
"56088"
123 × 456 = "56088"
algo
master
.
io
Step:
Start: multiply "123" × "456"
0 / 30
Input
Standard
Simple
With Zero
Custom
num1
=
123
,
num2
=
456
0 / 30
algo
master
.
io
Step:
Start: multiply "123" × "456"