def differences(scansion: str, candidate: str) -> list:
    """"Given two strings, return a list of index positions where the contents differ.
    >>> differences("abc", "abz")
    [2]
    """
    before = scansion.replace(" ", "")
    after = candidate.replace(" ", "")
    diffs = []
    for idx, tmp in enumerate(before):
        if before[idx] != after[idx]:
            diffs.append(idx)
    return diffs