BMLL Technologies interview question

Python list slicing, dynamic programming