Queries for number of distinct elements from a given index till last index in an array
Given a array âa[]â of size n and number of queries q. Each query can be represented by a integer m. Your task is to print the number of distinct integers from index m to n i.e till last element of the array. Examples: Input: arr[] = {1, 2, 3, 1, 2, 3, 4, 5}, q[] = {1, 4, 6, 8} Output: 5 5 3 1 In qu