leetcode
279. Perfect Squares
Solution code
Time complexity: O(n sqrt(n))
Space complexity: O(n)