<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>d_tutuz</author_name>
  <author_url>https://blog.hatena.ne.jp/d_tutuz/</author_url>
  <blog_title>数学/競プロメモ</blog_title>
  <blog_url>https://tutuz.hateblo.jp/</blog_url>
  <categories>
  </categories>
  <description>問題 https://leetcode.com/problems/distinct-subsequences-ii/ 文字列 の部分文字列の個数を で求めよ 考え方 部分文字列DPのverify問題。公式のeditorialでは文字列の重複を許して部分文字列を生成した後、重複分の文字列数を差し引く...という解法になっている。ここではけんちょんさんの記事に従って、部分文字列を作るときに常に辞書順最小が保たれるような遷移をして、重複がないように部分文字列を生成する解法で考える。 重要なのは「同じ部分文字列を得るとしたら、辞書順最小になるように遷移する」ということである。 例として abab につ…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Ftutuz.hateblo.jp%2Fentry%2F2019%2F02%2F02%2F224633&quot; title=&quot;LeetCode：940. Distinct Subsequences II - 数学/競プロメモ&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>https://cdn-ak.f.st-hatena.com/images/fotolife/d/d_tutuz/20190202/20190202222304.png</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2019-02-02 22:46:33</published>
  <title>LeetCode：940. Distinct Subsequences II</title>
  <type>rich</type>
  <url>https://tutuz.hateblo.jp/entry/2019/02/02/224633</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
