i just wanted to know if yes then where to use it and where to not to use it(vector)
no, if you use vector in a similar way than array (without reallocations)
But this condition happens rarely, when the time limit is very strict.
But for knowledge remember that arrays are faster than vector.
the problem is not the use of vector but how you use it. Check the running time of your solution that uses vector when you are not making a copy of vector a each time you call the function construct
Okey, sorry that was a fault on my side.
But anyway thanks for correcting me, appreciate it.