I was doing some practice C++ and was curious as to how I could improve the following C++ code (it\'s from a hackerrank question).
int sockMerchant(int n, vec