https://leetcode.com/problems/excel-sheet-column-title


Runtime: 0 ms, faster than 100.00% of Go online submissions for Excel Sheet Column Title.
Memory Usage: 1.9 MB, less than 27.50% of Go online submissions for Excel Sheet Column Title.


```go
package main

import (
	"fmt"
	"strings"
)

var uppercase_ascii = []rune("ABCDEFGHIJKLMNOPQRSTUVWXYZ")

func integer_to_letter(num int) (string, int) {
	index := (num - (int(num/26) * 26)) % 26
    index -= 1
    if index < 0 {
        index = 26 + index
    }
	return string(uppercase_ascii[index]), int(num / 26)
}

func convertToTitle(columnNumber int) string {
	//7:02
	output := ""

	letter := ""
	left := columnNumber

	if left <= 26 {
		return string(uppercase_ascii[left-1])
	}

	for true {
		letter, left = integer_to_letter(left)
		output = letter + output

		//fmt.Println(letter, left)

		if left <= 26 {
			if output[0] == 'Z' {
				output = string(uppercase_ascii[left-2]) + output
			} else {
				output = string(uppercase_ascii[left-1]) + output
			}
			break
		}

	}
	return strings.ReplaceAll(output, "AAZ", "ZZ")
	//7:16
    //debug until 7:30
}
```