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.
You cannot use an array since the input is already given as a vector
In the main() function they are calling this function with a vector argument, not an array argument