Created
September 11, 2018 03:11
-
-
Save yokolet/c1002c72c08c6e0fa2fead56ec8dbebb to your computer and use it in GitHub Desktop.
Reverse String
This file contains hidden or 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
| """ | |
| Description: | |
| Write a function that takes a string as input and returns the string reversed. | |
| Example: | |
| Input: "A man, a plan, a canal: Panama" | |
| Output: "amanaP :lanac a ,nalp a ,nam A" | |
| """ | |
| # runs very fast :) | |
| def reverseString(s): | |
| """ | |
| :type s: str | |
| :rtype: str | |
| """ | |
| return s[::-1] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment