NewThe Learning module is now liveSee what's new

A data analyst is given an array data of integers representing daily data values. Elements may be positive, negative, or zero.

An array of range-negate updates is then applied in sequence. Each update updates[i] = [l, r] negates every element from index l to index r inclusively, using 1-based indexing. Negating an element means multiplying it by −1.

Test Cases
Input
Output
Expected