def 						A__  (					__A   , __A	):

    if not (isinstance(UpperCAmelCase__   , UpperCAmelCase__	) and isinstance(UpperCAmelCase__   , UpperCAmelCase__	)):
        raise ValueError("""longest_common_substring() takes two strings for inputs"""	)

    _lowerCamelCase     :		Optional[int] 						=						len(UpperCAmelCase__	)
    _lowerCamelCase     :		Union[str, Any] 						=						len(UpperCAmelCase__	)

    _lowerCamelCase     :		str 						=						[[0] * (texta_length + 1) for _ in range(texta_length + 1	)]
    _lowerCamelCase     :		Union[str, Any] 						=						0
    _lowerCamelCase     :		Dict 						=						0

    for i in range(1   , texta_length + 1	):
        for j in range(1   , texta_length + 1	):
            if texta[i - 1] == texta[j - 1]:
                _lowerCamelCase     :		int 						=						1 + dp[i - 1][j - 1]
                if dp[i][j] > ans_length:
                    _lowerCamelCase     :		List[Any] 						=						i
                    _lowerCamelCase     :		str 						=						dp[i][j]

    return texta[ans_index - ans_length : ans_index]


if __name__ == "__main__":
    import doctest

    doctest.testmod()





def 						A__  (					__A	):







    '''simple docstring'''
    _lowerCamelCase     :		Tuple 						=						0
    for ch in input_str:
        _lowerCamelCase     :		Optional[Any] 						=						ord(__A	)
        _lowerCamelCase     :		List[str] 						=						pow(2   , __A	)

        # If we already turned on bit for current character's unicode
        if bitmap >> ch_unicode & 1 == 1:
            return False
        bitmap |= ch_bit_index_on
    return True


if __name__ == "__main__":
    import doctest

    doctest.testmod()




