Write squares_up_to(n) that returns the list of perfect squares 1, 4, 9, 16, ... that are less than or equal to n, in increasing order. If no square fits, return an empty list.
Examples
Input: n = 20
Output: [1, 4, 9, 16]
Input: n = 0
Output: []
Constraints
-10**6 <= n <= 10**6
Goals
- Generate a sequence with a while loop that stops at a limit
- Collect the generated values in a list