
"""simple docstring"""




def 							a__ (				lowerCAmelCase	:       List[str]		):






     '''simple docstring'''
     UpperCAmelCase__							: Dict 							=						[0] * len(lowerCAmelCase		)
     UpperCAmelCase__							: Any 							=						[]
     UpperCAmelCase__							: str 							=						[1] * len(lowerCAmelCase		)

     for values in graph.values():
          for i in values:
               indegree[i] += 1

     for i in range(len(lowerCAmelCase		)		):
          if indegree[i] == 0:
               queue.append(lowerCAmelCase		)

     while queue:
          UpperCAmelCase__							: Union[str, Any] 							=						queue.pop(0		)
          for x in graph[vertex]:
               indegree[x] -= 1

               if long_dist[vertex] + 1 > long_dist[x]:
                    UpperCAmelCase__							: Dict 							=						long_dist[vertex] + 1

               if indegree[x] == 0:
                    queue.append(lowerCAmelCase		)

     print(max(lowerCAmelCase		)		)


# Adjacency list of Graph
A__      :	Optional[Any]          =    {0: [2, 3, 4], 1: [2, 7], 2: [5], 3: [5, 7], 4: [7], 5: [6], 6: [7], 7: []}

longest_distance(graph)





"""simple docstring"""




def 							a__ (				lowerCAmelCase	:       list       ,    lowerCAmelCase	:       list		):






     '''simple docstring'''
     _validate_point(lowerCAmelCase		)
     _validate_point(lowerCAmelCase		)
     if len(lowerCAmelCase		) != len(lowerCAmelCase		):
          raise ValueError("Both points must be in the same n-dimensional space"		)

     return float(sum(abs(a - b		) for a, b in zip(lowerCAmelCase       ,    lowerCAmelCase		)		)		)



def 							a__ (				lowerCAmelCase	:       list[float]		):






     '''simple docstring'''
     if point:
          if isinstance(lowerCAmelCase       ,    lowerCAmelCase		):
               for item in point:
                    if not isinstance(lowerCAmelCase       ,    (int, float)		):
                         UpperCAmelCase__							: Tuple 							=						(
                             "Expected a list of numbers as input, found "
                             F"{type(lowerCAmelCase		).__name__}"
                         )
                         raise TypeError(lowerCAmelCase		)
          else:
               UpperCAmelCase__							: Dict 							=						F"Expected a list of numbers as input, found {type(lowerCAmelCase		).__name__}"
               raise TypeError(lowerCAmelCase		)
     else:
          raise ValueError("Missing an input"		)



def 							a__ (				lowerCAmelCase	:       list       ,    lowerCAmelCase	:       list		):






     '''simple docstring'''
     _validate_point(lowerCAmelCase		)
     _validate_point(lowerCAmelCase		)
     if len(lowerCAmelCase		) != len(lowerCAmelCase		):
          raise ValueError("Both points must be in the same n-dimensional space"		)

     return float(sum(abs(x - y		) for x, y in zip(lowerCAmelCase       ,    lowerCAmelCase		)		)		)


if __name__ == "__main__":
    import doctest

    doctest.testmod()



