Plz correct this

every thing is correct only mistake is while printing the vector
you are printing first element but poping last element so it will always print first element

also your input is wrong all arrays should be sorted

Modified Code

i hope this helps
if yes hit a like and don’t forgot to mark doubt as resolved
if you have more doubts regarding this feel free to ask