Queries to update Subarrays of a given Array using Disjoint Set
Given an array arr[] consisting of N integers, consisting only of 0's initially and queries Q[][] of the form {L, R, C}, the task for each query is to update the subarray [L, R] with value C. Print the final array generated after performing all the queries. Examples: Input: N = 5, Q = {{1, 4, 1}, {3, 5, 2}, {2, 4, 3}} Output: 1 3 3 3 2 Explanation: