Amazon interview question

They gave me two algorithm problems.