✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.
What is the time complexity of the following function if measured with respect to n?
def mystery(n: int) -> int:
count = 0
for i in range(n):
count += 1
if n == 0:
return count
else:
return mystery(n - 1)