using vector to solve the problem lands me to TLE but the same logic used by the array got accepted. WHY?
SOLN (by vector): (https://codeforces.com/problemset/submission/1747/184215576). SOLN (by array): (https://codeforces.com/problemset/submission/1747/184217645)