cybersecurity · intermediate · ~15 min · safe pentest lab

Count subdomains

Count non-empty lines.

Challenge

Implement int count_subdomains(const char *list) returning the number of non-empty newline-separated lines.

Starter code

int count_subdomains(const char *list) {
    /* TODO */
    return 0;
}

Solve this exercise in the browser editor — compile and run against the test harness, no setup required.