Pregunta de entrevista de Amazon

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