279. Perfect Squares

Given a positive integer n, find the least number of perfect square numbers (for example, 1, 4, 9, 16, ...) which sum to n. Example 1: Input: n = Output: 3 Explanation: 1212 = 4 + 4 + 4. Example 2:
相關文章
相關標籤/搜索