Citrus Pay interview question

DS, mostly trees and lists with problem solving