In the problem find-all-anagrams-in-a-string, one tries to find all anagrams of a string $p$ (of length $k$) in a string $s$ (of length $n$) and return a list of the anagrams' starting indices.
The solution is to use a sliding window of length $k$ and move that window from the first index all the way up index $n - k + 1$. However, the solution states that the space complexity is $O(1)$ instead of $O(n)$. This is confusing to me, as shouldn't it be $O(n)$ as the worst case scenario is that $p$ is 1 character and $s$ (with length $n$) is comprised solely of $p$'s character? Then the start indices list we would return would be of length $n$.