Created
January 10, 2019 02:49
-
-
Save developersoom/43841a11b04e2093fd3bd3ee880ce7d1 to your computer and use it in GitHub Desktop.
getMidStr
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
function solution(s) { | |
return s.length%2 === 0 ? s[(s.length/2)-1]+s[s.length/2] : s[Math.floor(s.length/2)]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment