Can somebody explain this?


#1

In the editorial, they used vector. but if I use an array instead of vector then the answer I’m getting is wrong. I have coded the same as given in the solution.


#2

You cannot use an array since the input is already given as a vector


#3

In the main() function they are calling this function with a vector argument, not an array argument