๐Ÿงฌ ์•Œ๊ณ ๋ฆฌ์ฆ˜/leetcode

    [Leetcode][JS] 1630. Arithmetic Subarrays

    1630. Arithmetic Subarrays ๋ฌธ์ œ ์ตœ์†Œ ๋‘ ๊ฐœ์˜ ์›์†Œ๋กœ ๊ตฌ์„ฑ๋˜์–ด์žˆ๋Š” ๊ฒฝ์šฐ, ์—ฐ์†์ ์ธ ๋‘๊ฐœ์˜ ์›์†Œ์˜ ์ฐจ์ด๊ฐ€ ๋™์ผํ•˜๋ฉด arithmeticํ•˜๋‹ค๊ณ  ํ•œ๋‹ค s[i + 1] - s[i] == s[1] - s[0] ์ธ ๊ฒฝ์šฐ, artimeticํ•˜๋‹ค ๋”๋ณด๊ธฐ A sequence of numbers is called arithmetic if it consists of at least two elements, and the difference between every two consecutive elements is the same. More formally, a sequence s is arithmetic if and only if s[i+1] - s[i] == s[1] - s[0] for all vali..