Question d’entretien chez Amazon

Code a solution to a specific problem in a whiteboard and explain its complexity O(n)