Skip to content

NeelamVerma/FlowerBouquetDP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

*Dynamic Programming basic example:

A person can create a flower bouquet with either 3 roses (cost of bouquet = p) or 1 rose and 1 lily (cost = q) In an array of flowers, the person has to select contiguous set of flowers i.e. 2 or 3 to gain maximum cost.

Input format: A string of 0(denotes rose) and 1(denotes lily). Output : Maximum cost.

Examples:

Input: p = 2, q = 3, s = 0001000 Output: 5

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published