def countWords(words):
    """count the number of words in an array of strings"""
    d = {}
    for word in words:
        if word not in d.keys():
            d[word] = 1
        else:
            d[word] += 1
    return d