The 'Concert Lineup' problem asks you to find the maximum enjoyment a concert promoter can get from a lineup of bands, with the constraint that no two bands of the same genre can play consecutively. It tests dynamic programming skills and optimization.
A music festival organizer needs to create a lineup of bands for a concert. Each band provides a certain level of enjoyment to the audience. However, to keep the audience engaged, no two bands of the same genre can play back-to-back. Given an array representing the enjoyment value of each band, determine the maximum total enjoyment the organizer can achieve by selecting a lineup that adheres to the genre constraint.
Imagine you're trying every possible combination of bands. For each combination, you'd check if any adjacent bands are of the same genre. If the combination is valid, you calculate the total enjoyment. You repeat this for every combination, keeping track of the maximum enjoyment found so far. This is like trying every single route on a map to find the shortest one - very time-consuming!
Work through this problem with AI coaching and get real-time feedback
Practice This Problem