def reverseString(s):
return s[::-1]
def reverseStr(s, k):
return s[:k][::-1] + s[k:2*k] + reverseStr(s[2*k:], k) if s else ''
def replaceSpace(s):
return s.replace(' ', '%20')
def reverseWords(s):
return ' '.join(s.split()[::-1])
def reverseLeftWords(s, n):
return s[n:] + s[:n]