from functools import reduce


def getChunk(the_list: list, num: int):
    """
    Example:
    if the_list: ['a', 'b', 'c', 'd', 'e', 'f'] and num: 3
    ['a', 'b', 'c', 'd', 'e', 'f'] -> ['a b c', 'b c d', 'c d e', 'd e f']

    :param the_list: ['a', 'b', 'c', 'd', 'e', 'f'].
    :param num: the number of words in a chunk.
    """
    i = range(num)

    def generate_list(shift: int):
        """
        Example:
        if shift: 1
        ['a', 'b', 'c', 'd', 'e', 'f'] -> ['b', 'c', 'd', 'e', 'f', '']

        :param num: the number of words in a chunk.
        """
        if shift == 0:
            return the_list
        ox=['']*len(the_list)
        ox[:-shift]=the_list[shift:]
        return ox

    # Create shifted lists from a given list
    r = list(map(generate_list,i))
    # Combine shifted lists into a list containing chunks
    combined = list(reduce(lambda x,y: map(lambda i,j: i + ' ' + j,x,y),r))
    # Cut list
    ending = combined[:-(num-1)] if num > 1 else combined

    return ending