Domanda di colloquio di Amazon

Algorithm questions that can be found on LC.