



"""simple docstring"""







def      __UpperCAmelCase      (    __lowerCamelCase						,     __lowerCamelCase						,     __lowerCamelCase	)							->      bool:
		return not any(
		    neighbour == 1 and colored_vertices[i] == color
		    for i, neighbour in enumerate(snake_case__	)	)



def      __UpperCAmelCase      (    __lowerCamelCase						,     __lowerCamelCase						,     __lowerCamelCase						,     __lowerCamelCase	)							->      bool:

		# Base Case
		if index == len(snake_case__	):
				return True

		# Recursive Step
		for i in range(snake_case__	):
				if valid_coloring(graph[index]						,     snake_case__						,     snake_case__	):
						# Color current vertex
						lowercase__   :    str				=			i
						# Validate coloring
						if util_color(snake_case__						,     snake_case__						,     snake_case__						,     index + 1	):
								return True
						# Backtrack
						lowercase__   :    Dict				=			-1
		return False





def      __UpperCAmelCase      (    __lowerCamelCase						,     __lowerCamelCase	)							->      list[int]:
		lowercase__   :    List[Any]				=			[-1] * len(snake_case__	)

		if util_color(snake_case__						,     snake_case__						,     snake_case__						,     0	):
				return colored_vertices

		return []





def 		UpperCamelCase	(   snake_case__       :    int       ,     snake_case__       :    int	)	->     int:
   return int(input_a == input_a == 0	)
def 		UpperCamelCase	(   )	->     None:
   print('Truth Table of NOR Gate:'	)
   print('|   Input 1   |  Input 2  | Output |'	)
   print(F"""|      0      |    0      |  {nor_gate(0       ,     0	)}     |"""	)
   print(F"""|      0      |    1      |  {nor_gate(0       ,     1	)}     |"""	)
   print(F"""|      1      |    0      |  {nor_gate(1       ,     0	)}     |"""	)
   print(F"""|      1      |    1      |  {nor_gate(1       ,     1	)}     |"""	)


if __name__ == "__main__":
    import doctest

    doctest.testmod()
    main()



