< 99 Elm Problems
Group the elements of a set into disjoint subsets.27.a) In how many ways can a group of 9 people work in 3 disjoint subgroups of 2, 3 and 4 persons? Write a function that generates all the possibilities and returns them in a list.27.b) Generalize the function to allow group sizes to be specified.
# # # THIS IS A STUB # # #
Example in Elm:
import Html exposing (text)
import List
f : Int -> Int
-- your implementation goes here
main = text (toString (f 0))
Result:
4
This article is issued from Wikibooks. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.