https://romankurnovskii.com/ru/tracks/algorithms-101/leetcode/hard/1622/
1622. Fancy Sequence