Created
April 13, 2020 22:33
-
-
Save Nicknyr/6aa05c9d81cd0d69061643dc5a369104 to your computer and use it in GitHub Desktop.
CodeSignal - Enclose in Brackets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Given a string, enclose it in round brackets. | |
Example | |
For inputString = "abacaba", the output should be | |
encloseInBrackets(inputString) = "(abacaba)". | |
*/ | |
function encloseInBrackets(inputString) { | |
let parathesis1 = '('; | |
let parathesis2 = ')'; | |
let answer = parathesis1 + inputString + parathesis2; | |
return answer; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment