Compute minimal cost to merge numbers | Morgan Stanley