Expedia Group interview question

Simple Coding Questions based on DP or trees and Linked lists