Most frequent element in Array after replacing given index by K for Q queries
Given an array arr[] of size N, and Q queries of the form {i, k} for which, the task is to print the most frequent element in the array after replacing arr[i] by k.Example : Input: arr[] = {2, 2, 2, 3, 3}, Query = {{0, 3}, {4, 2}, {0, 4}} Output: 3 2 2 First query: Setting arr[0] = 3 modifies arr[]