Honey Butter Chip
InterviewTime limit5sMemory limit256 MB
Arrange the M extra bags within the N fixed bags and pick no two adjacent bags to maximize the chip total.
- Level
Medium5 of 10
- Topics
- Dynamic programming, Array
- Solved
- No attempts yet
Problem
Insert M bags among N ordered bags, then pick a non-adjacent subset to maximize chips.
Input
Read N, list A, M, list B.
Output
Print the maximum number of chips.