Amazon interview question

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