Created
November 1, 2023 20:33
-
-
Save tirnovar/cbe33e8026d81a4d78435309b611605b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (series as list) => | |
| [ | |
| bfr = List.Buffer(series), | |
| len = List.Count(bfr), | |
| additions = List.Combine( | |
| List.Generate( | |
| () => [ | |
| id = 0, | |
| currVal = bfr{id}, | |
| others = List.Skip(bfr, id + 1) | |
| ], | |
| each _[id] < len, | |
| each [ | |
| id = [id] + 1, | |
| currVal = bfr{id}, | |
| others = List.Skip(bfr, id + 1) | |
| ], | |
| each | |
| [ | |
| vl = [currVal], | |
| countr = List.Count([others]), | |
| lst = [others], | |
| iterator = List.Transform(List.Numbers(0, countr), each List.Skip(lst, _)), | |
| accumulator = List.Union( | |
| List.Transform(iterator, each List.Accumulate(_, {vl}, (s, c) => s & {(List.Last(s) & c)})) | |
| ) | |
| ][accumulator] | |
| ) | |
| ) | |
| & {List.Last(bfr)} | |
| ][additions] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment