
You are given two 0-indexed arrays nums1 and nums2 and a 2D array queries of queries. There are three types of queries:
For a query of type 1, queries[i] = [1, l, r] . Flip the values from 0 to 1 and from 1 to 0 in nums1 from index l to index r . Both l and r are 0-indexed .
For a query of type 2, queries[i] = [2, p, 0] . For every index 0 <= i < n , set nums2[i] = nums2[i] + nums1[i] * p .
For a query of type 3, queries[i] = [3, 0, 0] . Find the sum of the elements in nums2 .
Return an array containing all the answers to the third type queries.
1 <= nums1.length,nums2.length <= 10 ^5nums1.length = nums2.length1 <= queries.length <= 10 ^5queries[i].length = 30 <= l <= r <= nums1.length - 10 <= p <= 10 ^60 <= nums1[i] <= 10 <= nums2[i] <= 10 ^9