Pergunta de entrevista da empresa Amazon

Buy and sell stocks II with some complexities and modifications