GIC interview question

Algorithm, data structure, dynamic programming