2808 explained code solutions for 75 technologies


golangHow to sort slice


package main
import "sort"

func main() {
	arr := []int{3,1,7,2}
	sort.Ints(arr)
}ctrl + c
import

loads net package which provides a portable interface for network I/O and the fmt to print out the nserver

func main() {

declare main function that will be launched automatically

[]int{3,1,7,2}

create slice with 4 int values

sort.Ints(

sorts slice of int values