Sum Of Infinite Array Leetcode Question