Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
F# には N 要素の長いリストがあり、連続したサブリスト (M < N) と重複する可能性のあるすべての M 要素を抽出したいと思います。たとえば、次のようになります。
[1; 2; 3; 4; 5]
生産する
[[1; 2; 3]; [2; 3; 4]; [3; 4; 5]]
M = 3 の場合。
私はそれを行う必須の方法を知っていますが、それを行うための簡潔な機能的なトリックはありますか?
このための組み込み関数があります。Seq.windowed
Seq.windowed