Doubt in map of vector

i have created a map of vector to solve this question but i think on passing to a function the values int the vector are being passed by value. how to pass it by reference? here is the code

sorry got the prblem