Pergunta de entrevista da empresa Google

Review x code that determine the high water mark. How would you improve the code