Time complexity

In this question how is the time complexity of the code equals to O(n) it should be O(n^2)

no its just o(n).theres just 1 loop till arr.length