'''simple docstring'''






import operator





def  _SCREAMING_SNAKE_CASE		(      __snake_case							:			list   ,		__snake_case							:			bool = False   ,		__snake_case							:			list | None = None				):
     _A    		=  operator.lt if reverse else operator.gt
     _A    		=  solution or []

     if not arr:
          return solution

     _A    		=  [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:
               _A    		=  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]








'''simple docstring'''






import os

try:
     from .build_directory_md import good_file_paths
except ImportError:
     from build_directory_md import good_file_paths  # type: ignore

lowerCAmelCase:   Optional[int]					=		list(good_file_paths())
assert filepaths, "good_file_paths() failed!"

lowerCAmelCase:   Optional[Any]					=		[file for file in filepaths if file != file.lower()]
if upper_files:
     print(F"{len(upper_files)} files contain uppercase characters:")
     print('\n'.join(upper_files) + '\n')

lowerCAmelCase:   int					=		[file for file in filepaths if ' ' in file]
if space_files:
     print(F"{len(space_files)} files contain space characters:")
     print('\n'.join(space_files) + '\n')

lowerCAmelCase:   Union[str, Any]					=		[file for file in filepaths if '-' in file]
if hyphen_files:
     print(F"{len(hyphen_files)} files contain hyphen characters:")
     print('\n'.join(hyphen_files) + '\n')

lowerCAmelCase:   Union[str, Any]					=		[file for file in filepaths if os.sep not in file]
if nodir_files:
     print(F"{len(nodir_files)} files are not in a directory:")
     print('\n'.join(nodir_files) + '\n')

lowerCAmelCase:   int					=		len(upper_files + space_files + hyphen_files + nodir_files)
if bad_files:
     import sys

     sys.exit(bad_files)