Lower Bound Questions Leetcode Javascript Solution