Time complexity analysis

kindly provide the solution with an explanation.