calculating number of queries
int q = queries . length ; for ( int i = 0 ; i < q ; i ++ ) { int start = queries [ i ] [ 0 ] ; int end = queries [ i ] [ 1 ] ; System . out . println ( " Answer ▁ for ▁ Query ▁ " + ( i + 1 ) + " ▁ = ▁ " + solveQuery ( start , end , A ) ) ; } } }