Span Of Array Leetcode Questions Java