diff --git a/exercises/reverse-string/canonical-data.json b/exercises/reverse-string/canonical-data.json new file mode 100644 index 0000000000..b3e207a4aa --- /dev/null +++ b/exercises/reverse-string/canonical-data.json @@ -0,0 +1,39 @@ +{ + "exercise": "reverse-string", + "version": "1.0.0", + "comments": [ + "If property based testing tools are available, a good property to test is reversing a string twice: reverse(reverse(string)) == string" + ], + "cases": [ + { + "description": "empty string", + "property": "reverse", + "input": "", + "expected": "" + }, + { + "description": "a word", + "property": "reverse", + "input": "robot", + "expected": "tobor" + }, + { + "description": "a capitalized word", + "property": "reverse", + "input": "Ramen", + "expected": "nemaR" + }, + { + "description": "a sentence with punctuation", + "property": "reverse", + "input": "I'm hungry!", + "expected": "!yrgnuh m'I" + }, + { + "description": "a palindrome", + "property": "reverse", + "input": "racecar", + "expected": "racecar" + } + ] +} \ No newline at end of file diff --git a/exercises/reverse-string/description.md b/exercises/reverse-string/description.md new file mode 100644 index 0000000000..473c42f54a --- /dev/null +++ b/exercises/reverse-string/description.md @@ -0,0 +1,5 @@ +Reverse a string + +For example: +input: "cool" +output: "looc" diff --git a/exercises/reverse-string/metadata.yml b/exercises/reverse-string/metadata.yml new file mode 100644 index 0000000000..e6e9c4d7c3 --- /dev/null +++ b/exercises/reverse-string/metadata.yml @@ -0,0 +1,5 @@ +--- +blurb: "Reverse a string" +title: "reverse-string" +source: "Introductory challenge to reverse an input string" +source_url: "https://medium.freecodecamp.org/how-to-reverse-a-string-in-javascript-in-3-different-ways-75e4763c68cb" \ No newline at end of file