Minimum Common Value Leetcode Solution Github Java