https://leetcode.com/problems/largest-number



Runtime: 8 ms, faster than 8.45% of Go online submissions for Largest Number.
Memory Usage: 3.4 MB, less than 11.27% of Go online submissions for Largest Number.



```go
package main

import (
	"sort"
	"strconv"
    "strings"
)

type byMyRule []string

func (s byMyRule) Len() int {
	return len(s)
}
func (s byMyRule) Swap(i, j int) {
	s[i], s[j] = s[j], s[i]
}
func (s byMyRule) Less(i, j int) bool {
	a, _ := strconv.Atoi(s[i] + s[j])
	b, _ := strconv.Atoi(s[j] + s[i])
	if a > b {
		return true
	} else {
		return false
	}
}

func largestNumber(nums []int) string {
	//7:03
	num_string_list := make([]string, 0)
	for _, n := range nums {
		num_string_list = append(num_string_list, strconv.Itoa(n))
	}
	sort.Sort(byMyRule(num_string_list))

	result := ""
	for _, n := range num_string_list {
        result += n
	}
    result = strings.TrimLeft(result, "0")
    if result == "" {
        return "0"
    } else {
        return result
    }
	//7:11
    //debug until 7:16
}
```