Company: Cargill_5oct
Difficulty: medium
Minimum Tax in Journey Problem Description Consider a city with toll plazas represented as nodes in an undirected and unrooted tree with n nodes, indexed from 0 to n-1 . The connections between toll plazas are described by the 2D integer array paths , where paths[i] = [a, b] indicates that there is an edge between nodes a and b in the tree. Each toll plaza has an associated tax, and you are given an integer array tax , where tax[i] represents the tax required to cross node i . The total tax of any path is defined as the sum of the taxes of all nodes on that path. Now, you are provided with a 2D integer array journeys , where journeys[i] = [start, end] indicates the i th journey, starting from node start and traveling to node end using any valid path. Before performing every journey, you can choose some non-adjacent toll plazas and halve the taxes of those plazas. Your task is to determine the minimum total tax sum to perform all the given journeys. Input Format The input is provided in