For problem E, this code, implemented using unordered_map, was giving MLE. So, I switched to 2D array. However, now this is giving TLE. Isn't 2D array faster than unordered_map? How is it giving TLE when the former isn't? Is it because of any UB?
Time complexity: O(n * k + total_t_len + q * k)
Space complexity: n* k * 4 bytes = 1000000 * 26 * 4 ≈ 100MB (fits comfortably in 512MB)








