How to sort an array in go without mutation the original array in Go

后端 未结 0 610
青春惊慌失措
青春惊慌失措 2020-12-30 20:01

In Golang, I am trying to sort an array without mutating the original value

func main() {
    originalArray := []int{4, 2, 1, 1, 2}
    newArray := originalAr         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题