digits. Return every valid IP address you can get by inserting three dots into it. You may not reorder, remove or add digits.
The addresses may be returned in any order.digits='10010' → ['1.0.0.10', '10.0.1.0']
"1.0.0.10" and "10.0.1.0" work. "100.1.0" has only three numbers, and "1.00.1.0" fails because of the leading zero in "00".
digits='7001' → ['7.0.0.1']
With four digits every number is a single digit, so there is exactly one option, "7.0.0.1".
digits='1234567890123' → []
Thirteen digits cannot fit into four numbers of at most three digits each, so there are no addresses.
len(digits) ≤ 20digits consists of digits onlydigits='10010'
['1.0.0.10', '10.0.1.0']
Run checks the first 3 tests in your browser. Submit checks all 128 tests on the server, hidden ones included.