Skip to content

Latest commit

 

History

History
14 lines (10 loc) · 532 Bytes

File metadata and controls

14 lines (10 loc) · 532 Bytes

Problem 17: The IP Restorer (Restore IP Addresses)

Problem Statement

A valid IP address consists of exactly four integers separated by single dots. Each integer is between 0 and 255 (inclusive) and cannot have leading zeros. Given a string s containing only digits, return all possible valid IP addresses that can be formed by inserting dots into s.

Input Format

  • A string s of digits.

Constraints

  • 1 <= s.length <= 20

Example

Input: s = "25525511135"
Output: ["255.255.11.135","255.255.111.35"]