← ALL NOTES
String

93. Restore IP Addresses

Four segments, each 1–3 digits — so the search space is tiny. The first three segment lengths pin down the fourth, and each length is in {1,2,3}, giving at most 3×3×3 = 27 splits. So skip heavyweight…

Loading…