
You are given two 0-indexed integer arrays nums and removeQueries , both of length n . For the i ^th query, the element in nums at the index removeQueries[i] is removed, splitting nums into different segments.
A segment is a contiguous sequence of positive integers in nums . A segment sum is the sum of every element in a segment.
Return an integer array answer , of length n , where answer[i] is the maximum segment sum after applying the i ^th removal.
Note: The same index will not be removed more than once.
n == nums.length == removeQueries.length1 <= n <= 10 ^51 <= nums[i] <= 10 ^90 <= removeQueries[i] < nAll the values of removeQueries are unique .