1 line Python


  • 0
        return ''.join(s[i:i+k][::-1] + s[i+k:i+2*k] for i in range(0,len(s),2*k))

Log in to reply
 

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