What is space and time complexity?

here is my code

for 1 testcase
Time complexity: O(n)
Auxiliary space: O(n)