vector has 0 as its default value and if you access out of bounds also vector takes a big memory as new values may be added in future.
1 Like
Thank you very much
can anyone please explain why using arrays causes TLE,
while using vector it gives correct answer !
Using arrays will not cause TLE. Probably you could share your code
1 Like