Learn
Practice
Interview
Resources
Newsletter
F
Toggle theme
0
F
0
Toggle menu
Animations
← Back to All Animations
Restore IP Addresses
Brute Force
Backtracking
Standard
All Zeros
All Ones
Leading Zeros
Custom
s
=
25525511135
digit string
2
0
5
1
5
2
2
3
5
4
5
5
1
6
1
7
1
8
3
9
5
10
split into 4 segments, each 0-255 with no leading zeros
result
0
(none yet)
digit string
2
0
5
1
5
2
2
3
5
4
5
5
1
6
1
7
1
8
3
9
5
10
split into 4 segments, each 0-255 with no leading zeros
result
0
(none yet)
digit string
2
0
5
1
5
2
2
3
5
4
5
5
1
6
1
7
1
8
3
9
5
10
split into 4 segments, each 0-255 with no leading zeros
result
0
(none yet)
lengths a=2, b=3, c=3, d=3
2
0
5
1
5
2
2
3
5
4
5
5
1
6
1
7
1
8
3
9
5
10
.
.
.
✓
> 255
> 255
✓
25
.
525
.
511
.
135
✗ skip
result
0
(none yet)
lengths a=3, b=2, c=3, d=3
2
0
5
1
5
2
2
3
5
4
5
5
1
6
1
7
1
8
3
9
5
10
.
.
.
✓
✓
> 255
✓
255
.
25
.
511
.
135
✗ skip
result
0
(none yet)
lengths a=3, b=3, c=2, d=3
2
0
5
1
5
2
2
3
5
4
5
5
1
6
1
7
1
8
3
9
5
10
.
.
.
✓
✓
✓
✓
255
.
255
.
11
.
135
✓ valid
result
1
255.255.11.135
lengths a=3, b=3, c=3, d=2
2
0
5
1
5
2
2
3
5
4
5
5
1
6
1
7
1
8
3
9
5
10
.
.
.
✓
✓
✓
✓
255
.
255
.
111
.
35
✓ valid
result
2
255.255.11.135
255.255.111.35
digit string
2
0
5
1
5
2
2
3
5
4
5
5
1
6
1
7
1
8
3
9
5
10
2 valid IP addresses
result
2
255.255.11.135
255.255.111.35
Step:
Pick three cut lengths; the fourth is forced. Validate all four segments.
0 / 6
Standard
All Zeros
All Ones
Leading Zeros
Custom
s
=
25525511135
0 / 6
Step:
Pick three cut lengths; the fourth is forced. Validate all four segments.