【Leetcode】279. Perfect Squares

题目地址: https://leetcode.com/problems/perfect-squares/html 给定一个正整数,问它能够分解为最少多少个彻底平方数之和(不包括 0 0 0)。java 法1:动态规划。能够开一个数组 f [ i ] f[i] f[i],表示 i i i能够用最少多少个彻底平方数之和表示。那么当已知小于 n n n的 f f f值,就能够经过一遍循环来算出 f [
相关文章
相关标签/搜索