text: Driver code
code: public static void Main ( String [ ] args ) { int [ ] a = { 1 , 2 , 3 , 1 , 2 , 3 , 4 , 5 } ; int n = a . Length ; int [ ] queries = { 0 , 3 , 5 , 7 } ; int q = queries . Length ; find_distinct ( a , n , q , queries ) ; } }