We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 12fb5d5 commit 69e4ef2Copy full SHA for 69e4ef2
public/data/cpp.json
@@ -6,9 +6,12 @@
6
"title": "Reverse String",
7
"description": "Reverses the characters in a string.",
8
"code": [
9
- "string reverseString(const string& input) {",
10
- " string reversed = input;",
11
- " reverse(reversed.begin(), reversed.end()); // Using STL's reverse function",
+ "#include <string>",
+ "#include <algorithm>",
+ "",
12
+ "std::string reverseString(const std::string& input) {",
13
+ " std::string reversed = input;",
14
+ " std::reverse(reversed.begin(), reversed.end());",
15
" return reversed;",
16
"}"
17
],
0 commit comments