Tag Archive for 'power set'

Programming exercise: combinations of a string

[Permalink]

The problem is to implement a function that outputs all possible combinations of the characters in a string (with length ranging from one to the length of the string). Unlike permutations, two combinations are considered to be the same if they contain the same characters, but in a different order. Another way to define the problem is to find the power set of the characters of the string (excluding the empty set).

Like the previous exercise, this one is also from the book Programming Interviews Exposed by John Mongan and Noah Suojanen[1]\(\)… » [Expand post] [Permalink]

2 Comments