Let’s get into the problem directly without much description this time :D .

You are given an array **A** of **N** integers. The elements of the array are **A**1, **A**2, **A**3 … **A**N . You are also given **Q** queries to perform on this array **A**. In each query, you will be given three integers **L, R, X** where **[L, R]** denotes a sub-segment of the array **A** starting at **A**L and ending at **A**R. You have to find the minimum number of operations needed to make all values of the sub-segment, **[L, R]** of the array **A** equal to **X** i.e. **A**L = **A**L+1 = **A**L+2 = … = **A**R = **X**.

This is a companion discussion topic for the original entry at https://toph.co/p/a-super-easy-problem---array-query