Pregunta de entrevista de Amazon

mountain peek question regarding subsequence