Problems > Valid IPv4 Address > Editorial

Valid IPv4 Address — Solution & Editorial

Back to the Problem

Split on dots: exactly four all-digit parts, each ≤ 255, no leading zero unless the part is exactly 0.

Complexity: O(|S|)