def get_j_indices(plaintext):
    """Description: for a given string input, returns a list containing the
    indices in which the letter 'j' occurs.

    Arguments:
        plaintext (string): string used to either encode or decode.
    Returns:
        j_indices (list): list contains all indices in which 'j' occurs.
    """
    j_indices = []
    count = 0
    space_removed_plaintext = [i for i in plaintext if i != ' ']
    for i in space_removed_plaintext:
        if i == 'j':
            j_indices.append(count)
        count += 1
    return j_indices