For the problem Minion AND Range Problem Code: MINIAND my solution is giving TLE whereas it should pass the test cases in the given time limit.
Logic Used :
Used a prefix array(named - eo) which stores the no of even numbers encountered till i’th position in the given array
During query, checked whether the given range l-r contains any even number or not (lookup in eo by doing eo[r-1] - eo[l-1] >0 and also checked l’th element eo[l-1] - eo[l-2]>0).
for my approach the time complexity should be O(t(n+q)) which suffice enough to pass all condition within the given time limit, but still getting TLE.