Minimum Common Value Leetcode Javascript Interview