C++ Solution to Leetcode 462. Minimum Moves to Equal Array Elements II