O(n) linear space
easy 14 minO(n) space means the extra memory an algorithm needs grows in proportion to its input: double n and the memory doubles.
O(n) space means the extra memory an algorithm needs grows in proportion to its input: double n and the memory doubles.