<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>sosodemonai</author_name>
  <author_url>https://blog.hatena.ne.jp/sosodemonai/</author_url>
  <blog_title>Neunomizuの日記</blog_title>
  <blog_url>https://propyon.hateblo.jp/</blog_url>
  <categories>
    <anon>leetcode</anon>
  </categories>
  <description>tags: leetcode 問題 Explore Problems アイデア ｢正整数 $n$ が与えられた時， $n$ を平方数の和だけで表した時に，使うのに必要な最小の平方数の数を返せ｣という問題です． よくわからない… 解法 動的計画法でした(完) 配列を dp[i番目までの数] = iを平方数の和で表したときの最小の平方数の個数 として，後は各平方数ごとに配列を更新する． 計算量 時間計算量 $O(n \sqrt{n})$ 空間計算量 $O(n)$ Python class Solution: def numSquares(self, n: int) -&gt; int: dp = [fl…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fpropyon.hateblo.jp%2Fentry%2F2020%2F05%2F14%2F230109&quot; title=&quot;# LeetCode Medium 279. Perfect Squares - Neunomizuの日記&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2020-05-14 23:01:09</published>
  <title># LeetCode Medium 279. Perfect Squares</title>
  <type>rich</type>
  <url>https://propyon.hateblo.jp/entry/2020/05/14/230109</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
