Triplebyte interview question

Time complexity of given algorithm