This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python3 | |
import argparse | |
import hashlib | |
def create_hashfiles_from_filelist(filelist, algorithm: str = 'sha3-512'): | |
''' | |
Iterate through a list of file paths and create files containing hashes of the target files. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
import typing.List | |
def thanos_sort(a: List[int]) -> List[int]: | |
'''Removes half of the list until it's perfectly balanced, like all things should be.''' | |
def _perfectly_balanced(a: List[int]) -> bool: | |
like_all_things_should_be = True | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def split_string_into_rows(string: str, row_length: int = 10) -> str: | |
''' Splits a string into rows of a specified length. | |
Rows are separated by \n characters. | |
NOTE: This function may break if there are already \n characters in the string. | |
''' | |
# The character separating the rows | |
added_character = '\n' |