On Jul 6, 12:34 pm, lad4bear <[email protected]> wrote:
> Hi Guys,
>
> Here is my situation.
>
> The set of room types available is [s, d, t]. A user specifies the
> number of rooms required [n] and I have to generate a list of
> permutations.
>
> So where n=3 we get [sss, ssd, sst, sdt, std, etc]
>
> The problem I have is that sdt and std really are the same.
>
> How can I get an efficient list of permutations but without
> duplicates?

Easy enough, just pick elements whose index is larger
than or equal to the last element chosen instead of picking
from the entire set.

--
Geoff
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at http://groups.google.com/group/algogeeks
-~----------~----~----~----~------~----~------~--~---

Reply via email to