문자로 구성된 배열을 input으로 전달하면, 문자를 뒤집어서 return 해주세요.
Input: ["h","e","l","l","o"]
Output: ["o","l","l","e","h"]
Input: ["H","a","n","n","a","h"]
Output: ["h","a","n","n","a","H"]
def reverseString(s):
return s[::-1]
def reverseString(s) :
a, b = 0, len(s) - 1
while a <= b:
s[a], s[b] = s[b], s[a]
a += 1
b -= 1
return s
# def reverseString(s) :
# return s[::-1]