MCPcopy Create free account
hub / github.com/SuprDewd/CompetitiveProgramming / rand_string

Function rand_string

code/strings/kmp.test.cpp:1–12  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1string rand_string(int l, int h) {
2 int len = uniform_int_distribution(l, h)(rng);
3 stringstream ss;
4 rep(i,0,len) {
5 if (rng() % 2 == 0) {
6 ss << static_cast<char>(rng() % 26 + 'a');
7 } else {
8 ss << static_cast<char>(rng() % 26 + 'A');
9 }
10 }
11 return ss.str();
12}
13
14void test() {
15 rep(it,0,8000) {

Callers 1

testFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected