| 10 | class Solution { |
| 11 | public: |
| 12 | bool isPart(string str) { |
| 13 | if (str.size() > 3 or str.size() == 0) return false; |
| 14 | int i = stoi(str); |
| 15 | return i <= 255 and 0 <= i and (i == 0 ? str.size() == 1 : str[0] != '0'); |
| 16 | } |
| 17 | |
| 18 | vector<string> ipFromNPart(int n, string str) { |
| 19 | vector<string> res ; |