MCPcopy Create free account
hub / github.com/Ainevsia/Leetcode-Rust / isPart

Method isPart

93. Restore IP Addresses/Solution.cpp:12–16  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10class Solution {
11public:
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 ;

Callers 1

ipFromNPartMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected