http://www.nxcoding.com/archives/leetcode-daily-2799-count-complete-subarrays