maxQuality to keep track of the maximum quality found.maxQuality if the current quality is higher.
b. If the remaining time is non-negative, iterate over all adjacent nodes.
c. For each adjacent node, if visiting it does not exceed maxTime, continue DFS with updated time and quality.
d. If the adjacent node has not been visited before, add its value to the quality.maxQuality as the result.