Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import Data.List (delete)
- kSublistPermutations :: Eq a => Int -> [a] -> [[a]]
- kSublistPermutations 0 _ = []
- kSublistPermutations 1 xs = map (\x -> [x]) $ xs
- kSublistPermutations k xs = concatMap f xs where
- f x = map (x :) $ kSublistPermutations (k-1) $ delete x xs
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement