X

DAYS

:

HOUR

:

MINS

:

SEC

Lazy Bartender

Lazy Bartender :

There are N number of possible drinks.(n1,n2..)
Has C number of fixed customers.
Every customer has fixed favourite set of drinks.
Bartender has to create least possible number of drinks
to suffice need of all the customers
Example:
Cust1: n3,n7,n5,n2,n9
Cust2: n5
Cust3: n2,n3
Cust4: n4
Cust5: n3,n4,n3,n5,n7,n4

Output: 3(n3,n4,n5)
 

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