What is wrong with my code

Here is the link to my code – https://ide.codingblocks.com/s/328312
I opened the test cases for this question and my code is showing correct output for all of them, but I’m not able to pass all the test cases during submission.

@chaturvedia336,
vector<int> s(n); for(int i=0;i<n;i++) cin>>s[i];
Use this line for input.

I’m yet to start with the vectors section, can I take an input some other way…
Actually I had already solved it using an integer array, works completely fine, but since this question is from the strings section, I was trying to take a string input. Is that feasible?

@chaturvedia336,
You can do it, but take care if the input has numbers with more than one digit.

I’m not able to figure out a way of doing this. Can you please help me out…

@chaturvedia336,
Input each number in different string then you can use stoi().

I’m still not able to map this out…
It’s not compiling, help me out