Minimum Common Value Leetcode Solution