def listToCigar(array):
    """
	Converts a list to a cigar string

	I'm calling it an array, even though I know it's a list

	Args:
		array: A list coresponding to the cigar of interest
	Returns:
		cigar: A string representing the cigar sequence
	"""
    if array is None or len(array) == 0:
        return None
    cigar = ''
    previousChar = array[0]
    previousCount = 0
    for character in array:
        if previousChar != character:
            cigar += str(previousCount) + previousChar
            previousChar = character
            previousCount = 1
        else:
            previousCount += 1
    cigar += str(previousCount) + previousChar
    return cigar
