

from __future__ import annotations

def 			lowerCamelCase__			(       _a				,      _a):
	SCREAMING_SNAKE_CASE :   List[str]					  =							get_failure_array(__lowerCAmelCase)

	# 2) Step through text searching for pattern
	SCREAMING_SNAKE_CASE  ,SCREAMING_SNAKE_CASE :   Tuple					  =							0, 0  # index into text, pattern
	while i < len(__lowerCAmelCase):
		if pattern[j] == text[i]:
			if j == (len(__lowerCAmelCase) - 1):
				return True
			j += 1

		# if this is a prefix in our pattern
		# just go back far enough to continue
		elif j > 0:
			SCREAMING_SNAKE_CASE :   str					  =							failure[j - 1]
			continue
		i += 1
	return False

def 			lowerCamelCase__			(       _a):
	SCREAMING_SNAKE_CASE :   List[str]					  =							[0]
	SCREAMING_SNAKE_CASE :   str					  =							0
	SCREAMING_SNAKE_CASE :   Any					  =							1
	while j < len(__lowerCAmelCase):
		if pattern[i] == pattern[j]:
			i += 1
		elif i > 0:
			SCREAMING_SNAKE_CASE :   Dict					  =							failure[i - 1]
			continue
		j += 1
		failure.append(__lowerCAmelCase)
	return failure


if __name__ == "__main__":
			# Test 1)
			a_      =     'abc1abc12'
			a_      =     'alskfjaldsabc1abc1abc12k23adsfabcabc'
			a_      =     'alskfjaldsk23adsfabcabc'
			assert kmp(pattern, texta) and not kmp(pattern, texta)

			# Test 2)
			a_      =     'ABABX'
			a_      =     'ABABZABABYABABX'
			assert kmp(pattern, text)

			# Test 3)
			a_      =     'AAAB'
			a_      =     'ABAAAAAB'
			assert kmp(pattern, text)

			# Test 4)
			a_      =     'abcdabcy'
			a_      =     'abcxabcdabxabcdabcdabcy'
			assert kmp(pattern, text)

			# Test 5)
			a_      =     'aabaabaaa'
			assert get_failure_array(pattern) == [0, 1, 0, 1, 2, 3, 4, 5, 2]






'''simple docstring'''




from __future__ import annotations

_SCREAMING_SNAKE_CASE							     =			1.6021E-19  # units = C





def 	__lowerCamelCase			(      __lowerCAmelCase       :							float      ,    __lowerCAmelCase       :							float      ,    __lowerCAmelCase       :							float      ,    )		->  tuple[str, float]:
   if (conductivity, electron_conc, mobility).count(0		) != 1:
      raise ValueError("""You cannot supply more or less than 2 values"""		)
   elif conductivity < 0:
      raise ValueError("""Conductivity cannot be negative"""		)
   elif electron_conc < 0:
      raise ValueError("""Electron concentration cannot be negative"""		)
   elif mobility < 0:
      raise ValueError("""mobility cannot be negative"""		)
   elif conductivity == 0:
      return (
          "conductivity",
          mobility * electron_conc * ELECTRON_CHARGE,
      )
   elif electron_conc == 0:
      return (
          "electron_conc",
          conductivity / (mobility * ELECTRON_CHARGE),
      )
   else:
      return (
          "mobility",
          conductivity / (electron_conc * ELECTRON_CHARGE),
      )


if __name__ == "__main__":
 import doctest

 doctest.testmod()

