one line Python


  • 0
    class Solution(object):
    	def reverseStr(self, s, k):
    		
    		return ''.join(list(reversed(s[:k]))+list(s[k:2*k]))+self.reverseStr(s[2*k:],k) if len(s)!=0 else ''
    

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.