Pergunta de entrevista da empresa ServiceNow

To write code in O(n) complexity.