Equal - interviewbit

I am trying to solve the question. if I solve for one test case another arises. Please mark out the error in my code.

ide->https://ide.codingblocks.com/s/249848

ques->https://www.interviewbit.com/problems/equal/

@mikkyimran
you had to check if v vector was not empty. as it might remain empty and then it would get assign to ans

if(ans.size()==0){
                ans = v;
            }
            else if (!v.empty() and ans > v){

                ans = v;
            }