Pregunta de entrevista de Amazon

Asked a question on Combination sum and graph based problems