There is a group of n people labeled from 0 to n - 1, each with a different amount of money and a different level of quietness.
You are given an array richer where richer[i] = [a_i, b_i] indicates that person a_i has strictly more money than person b_i.
You are also given an integer array quiet where quiet[i] is the quietness of the i-th person. All values in quiet are unique.
For each person x, find the quietest person (the person y with the smallest quiet[y]) among all people who are at least as rich as person x (including person x themselves).
Return an integer array answer where answer[x] = y.
Input: richer = [[1,0],[2,1],[3,1],[3,7],[4,3],[5,3],[6,3]], quiet = [3,2,5,4,6,1,7,0]
Output: [5,5,2,5,4,5,6,7]
Explanation:
Input: richer = [[0,1],[1,2]], quiet = [0,1,2]
Output: [0,0,0]
Explanation: Person 0 is the richest and also the quietest. Everyone has person 0 as at least as rich, so all answers are 0.