
You have n boxes labeled from 0 to n - 1 . You are given four arrays: status , candies , keys , and containedBoxes where:
status[i] is 1 if the i ^th box is open and 0 if the i ^th box is closed,
candies[i] is the number of candies in the i ^th box,
keys[i] is a list of the labels of the boxes you can open after opening the i ^th box.
containedBoxes[i] is a list of the boxes you found inside the i ^th box.
You are given an integer array initialBoxes that contains the labels of the boxes you initially have. You can take all the candies in any open box and you can use the keys in it to open new boxes and you also can use the boxes you find in it.
Return the maximum number of candies you can get following the rules above .
n == status.length == candies.length == keys.length == containedBoxes.length1 <= n <= 1000status[i] is either 0 or 1 .1 <= candies[i] <= 10000 <= keys[i].length <= n0 <= keys[i][j] < nAll values of keys[i] are unique .0 <= containedBoxes[i].length <= n0 <= containedBoxes[i][j] < nAll values of containedBoxes[i] are unique.Each box is contained in one box at most.0 <= initialBoxes.length <= n0 <= initialBoxes[i] < n