DEV Community

Discussion on: Daily Challenge #88 - Recursive Ninjas

Collapse
 
axionbuster profile image
YuJin Kim
#include <sstream>
#include <string>

std::string chirp(size_t n_reps) {
    std::stringstream s;
    for (size_t i = 0; i < n_reps; ++i) {
        s << "chirp-";
    }
    std::string release = s.str();
    release.erase(--release.end());
    return release;
}

My first submission at Dev.To! (Excluding the welcome post). I love computer science.