Restore IP Addresses
Medium
Backtracking (Advanced)
Given a string of digits, print every valid IP address that can be formed by inserting three dots. Each part must be between 0 and 255 and must not have leading zeros (except the part 0 itself). Print the addresses in lexicographic order.
Constraints
1 <= len(s) <= 20
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.