def number_to_letter(num)
      result = +""

      until num.zero?
        num, index = (num - 1).divmod(26)
        result.prepend(LETTERS[index])
      end

      result
    end
def number_to_letter(num)
      result = +""

      until num.zero?
        num, index = (num - 1).divmod(26)
        result.prepend(LETTERS[index])
      end

      result
    end
convert a number to something like 'AB' (1 => 'A', 2 => 'B', ...)