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

Function toString

code/other/nth_permutation.test.cpp:1–9  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1string toString(vector<int> p) {
2 stringstream ss;
3 for (int i = 0; i < size(p); i++) {
4 if (i != 0) ss << ",";
5 ss << p[i];
6 }
7
8 return ss.str();
9}
10
11void test() {
12 assert_equal(string("0,1,2"), toString(nth_permutation(3, 0)));

Callers 1

testFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected