def getsize(data):
    """Return the smallest possible integer size for the given array."""
    maxdata = max(data)
    if maxdata < (1 << 8):
        return 1
    if maxdata < (1 << 16):
        return 2
    return 4