

'''simple docstring'''



import re


def       snake_case   (	snake_case      : str			) ->  list:


    """simple docstring"""


    return [char.split() for char in re.split(r'[^ a-z A-Z 0-9 \s]'					,		str_			)]


def       snake_case   (	snake_case      : str			) ->  str:


    """simple docstring"""


    lowerCAmelCase 						=							split_input(str_			)
    return "".join(
        [''.join([char.capitalize() for char in sub_str]			) for sub_str in string_split]			)


def       snake_case   (	snake_case      : str					,		snake_case      : bool					,		snake_case      : str			) ->  str:


    """simple docstring"""


    try:
        lowerCAmelCase 						=							split_input(snake_case			)
        if upper:
            lowerCAmelCase 						=							''.join(
                [
                    separator.join([char.upper() for char in sub_str]			)
                    for sub_str in string_split
                ]			)
        else:
            lowerCAmelCase 						=							''.join(
                [
                    separator.join([char.lower() for char in sub_str]			)
                    for sub_str in string_split
                ]			)
        return res_str
    except IndexError:
        return "not valid string"


def       snake_case   (	snake_case      : str			) ->  str:


    """simple docstring"""


    return to_simple_case(snake_case			)


def       snake_case   (	snake_case      : str			) ->  str:


    """simple docstring"""


    try:
        lowerCAmelCase 						=							to_simple_case(snake_case			)
        return res_str[0].lower() + res_str[1:]
    except IndexError:
        return "not valid string"


def       snake_case   (	snake_case      : str					,		snake_case      : bool			) ->  str:


    """simple docstring"""


    return to_complex_case(snake_case					,		snake_case					,		'_'			)


def       snake_case   (	snake_case      : str					,		snake_case      : bool			) ->  str:


    """simple docstring"""


    return to_complex_case(snake_case					,		snake_case					,		'-'			)


if __name__ == "__main__":
     __import__("doctest").testmod()








'''simple docstring'''



import operator


def       snake_case   (	snake_case      : list					,		snake_case      : bool = False					,		snake_case      : list | None = None			) ->  list:


    """simple docstring"""


    lowerCAmelCase 						=							operator.lt if reverse else operator.gt
    lowerCAmelCase 						=							solution or []

    if not arr:
        return solution

    lowerCAmelCase 						=							[arr.pop(0			)]
    for i, item in enumerate(snake_case			):
        if _operator(snake_case					,		sublist[-1]			):
            sublist.append(snake_case			)
            arr.pop(snake_case			)

    #  merging sublist into solution list
    if not solution:
        solution.extend(snake_case			)
    else:
        while sublist:
            lowerCAmelCase 						=							sublist.pop(0			)
            for i, xx in enumerate(snake_case			):
                if not _operator(snake_case					,		snake_case			):
                    solution.insert(snake_case					,		snake_case			)
                    break
            else:
                solution.append(snake_case			)

    strand_sort(snake_case					,		snake_case					,		snake_case			)
    return solution


if __name__ == "__main__":
     assert strand_sort([4, 3, 5, 1, 2]) == [1, 2, 3, 4, 5]
     assert strand_sort([4, 3, 5, 1, 2], reverse=True) == [5, 4, 3, 2, 1]





