Memory is limited too, and some solutions trade extra memory for speed. Space complexity measures the extra memory an algorithm needs as n grows, not counting the input itself. Think about it when you create a new array, a HashMap or a deep recursion, because each costs memory that grows with n. Interviewers often ask for both time and space, and sometimes for an O(1) space version of a working answer.