Minimum Common Value Leetcode Two