go解题答案

  • 思路概括:原地交换

  • 思路核心:

    func solve( str string ) string {
      // write code here\
      b:=[]byte(str)
      count:=len(b)
      for i:=0;i<count/2;i++{
          t:= b[i]
          b[i]=str[count-i-1] 
          b[count-i-1]=t
    
      }
      return string(b) 
    }

如果有帮助请点个赞哦, 更多文章请看我的博客

题主背景

  • 从业8年——超级内卷500Q技术经理——目前专注go和微服务架构