def find_number_to_keep(count_of_0, count_of_1, criteria) -> str:
    """
       Compare numbers according to a criteria ('most' or 'least').
       Criteria 'most' returns the number of which count is bigger.
       Criteria 'least' returns the number of which count is lesser.
       When counts are equal, criteria 'most' returns '1', and 'least' returns '0'
       Args:
           count_of_0 (int): count of numbers '0'
           count_of_1 (int): count of numbers '1'
           criteria (str): criteria for comparison
       Returns:
           str: resulting number (values '0' or '1')
    """
    if criteria == 'most':
        if count_of_0 == count_of_1:
            return '1'
        else:
            return '0' if count_of_0 > count_of_1 else '1'
    else:
        if count_of_0 == count_of_1:
            return '0'
        else:
            return '0' if count_of_0 < count_of_1 else '1'