Implement a function to find the longest path in a directed acyclic graph representing equipment logistics for EquipmentShare.
Use node IDs from 0 through n - 1. The function receives a node count, directed edges, a start node, and an end node, and returns the node IDs on any longest path from start to end, or [] if the end node is unreachable. The graph is guaranteed to be acyclic.
Signature: def longest_path(n, edges, start, end):
edges is a list of [from_node, to_node] pairs. Each edge has equal weight.
def longest_path(n, edges, start, end):