Expedia Group Interview Question

manipulate array and a dynamic programming