input: from typing import List
  import heapq
  def find_critical_edges_in_paths(n: int, edges: List[List[int]]) -> List[bool]:
      """
      You are given a weighted undirected graph with n vertices ranging from 0 to n - 1. This graph contains m edges represented by the 2D array edges, where edges[i] = [u_i, v_i, weight_i] specifies an edge between vertices u_i and v_i with weight weight_i.
  
      Analyze all shortest paths from vertex 0 to vertex n - 1 in this graph. You need to determine a boolean list result in which result[i] is true if the edge edges[i] is a component of at least one shortest path, and false otherwise.
  
      Return the boolean list result.
  
      Note that the graph may be disconnected.
  
      Examples:
      >>> n = 6, edges = [[0,1,4],[0,2,1],[1,3,2],[1,4,3],[1,5,1],[2,3,1],[3,5,3],[4,5,2]]
      [true,true,true,false,true,true,true,false]
      >>> n = 4, edges = [[2,0,1],[0,1,1],[0,3,4],[3,2,2]]
      [true,false,false,true]
  
      Constraints:
      2 <= n <= 50,000
      m == edges.length
      1 <= m <= min(50,000, n * (n - 1) / 2)
      0 <= u_i, v_i < n
      u_i != v_i
      1 <= weight_i <= 100,000
      No duplicate edges exist.
      """
output:     def dijkstra(source, n, adj_list):
      import heapq
      distances = [float('inf')] * n
      distances[source] = 0
      heap = [(0, source)]
  
      while heap:
          current_dist, u = heapq.heappop(heap)
          if current_dist > distances[u]:
              continue
          for weight, v in adj_list[u]:
              distance = current_dist + weight
              if distance < distances[v]:
                  distances[v] = distance
                  heapq.heappush(heap, (distance, v))
      return distances
  
  adj_list = [[] for _ in range(n)]
  for u, v, weight in edges:
      adj_list[u].append((weight, v))
      adj_list[v].append((weight, u))
  
  dist_from_start = dijkstra(0, n, adj_list)
  dist_from_end = dijkstra(n-1, n, adj_list)
  
  result = []
  for u, v, weight in edges:
      if dist_from_start[u] + weight + dist_from_end[v] == dist_from_start[n-1] or \
         dist_from_start[v] + weight + dist_from_end[u] == dist_from_start[n-1]:
          result.append(True)
      else:
          result.append(False)
  
  return result