How to approach this problem?

You have to make a necklace with pearls. Minimum number of pearls that can be used is 1 and maximum is n. Each pearl has a magnificence coefficient and the necklace should be such that the pearls are in ascending order of their magnificence. Find such number of necklaces that can be formed with given condition. Input given is n (no of pearls), Lowest magnificence and highest magnificence. Example n= 1, LM= 8 HM=9, so there can be 2 cases, one necklace with pearl 8 and one with pearl 9.

Author: shivamdurani
Login to Answer
Sort By:
Oldest
|
Newest
|
Vote
|
My Answer