"""
Created by Hadron DaVinci
https://hadrondavinci.com

For Educational Purposes
To Run:
    1) Download https://hadrondavinci.com/assets/code/2021-01-01/method1.py
    2) python method1.py
"""
from typing import Generator


def sub_seq(s: list) -> Generator:
    """
    Returns sub sequences in s
    :param s: some sequence
    :return:
    """
    for lw in range(0, len(s)):
        for rw in range(lw, len(s)):
            yield s[lw: rw + 1]     # s[lw, rw] in interval notation


# Try Code
if __name__ == "__main__":
    for s in sub_seq(['a', 'b', 'c', 'd', 'e']):
        print(s)
