Minimize Maximum Component Cost Leetcode