from typing import Union
from typing import List


def list_over(obj: Union[list, str], n: int) -> List[str]:
    """
    Return a list of strings of length greater than n in obj,
    or sublists of obj, if obj is a list.
    If obj is a string of length greater than n, return a list
    containing obj.  Otherwise return an empty list.

    >>> list_over("five", 3)
    ['five']
    >>> list_over("five", 4)
    []
    >>> list_over(["one", "two", "three", "four"], 3)
    ['three', 'four']
    """
    # new_list = []
    # # base Case:
    # if isinstance(obj, str):
    #     if len(obj) > n:
    #         new_list.append(obj)
    # else:
    #     # obj is a list.
    #     for item in obj:
    #         # item is either a string or another list.
    #         new_list.extend(list_over(item, n))
    # return new_list

    # with listcomp...
    # if isinstance(obj, str):
    #     if len(obj) > n:
    #         return [obj]
    #     else:
    #         return []
    # else:
    #     # obj is a list.
    #     return sum([list_over(item, n) for item in obj], [])

    # with listcomp and ternary...
    if isinstance(obj, str):
        return [obj] if len(obj) > n else []
    else:
        # obj is a list.
        return sum([list_over(item, n) for item in obj], [])