{"id":4838,"date":"2023-11-11T11:31:20","date_gmt":"2023-11-11T03:31:20","guid":{"rendered":"https:\/\/white-night.club\/?p=4838"},"modified":"2023-11-11T11:37:21","modified_gmt":"2023-11-11T03:37:21","slug":"ad145","status":"publish","type":"post","link":"https:\/\/white-night.club\/index.php\/2023\/11\/11\/ad145\/","title":{"rendered":"392.\u00a0\u5224\u65ad\u5b50\u5e8f\u5217"},"content":{"rendered":"\n<p>\u7ed9\u5b9a\u5b57\u7b26\u4e32\u00a0<strong>s<\/strong>\u00a0\u548c\u00a0<strong>t<\/strong>\u00a0\uff0c\u5224\u65ad\u00a0<strong>s<\/strong>\u00a0\u662f\u5426\u4e3a\u00a0<strong>t<\/strong>\u00a0\u7684\u5b50\u5e8f\u5217\u3002<\/p>\n\n\n\n<p>\u5b57\u7b26\u4e32\u7684\u4e00\u4e2a\u5b50\u5e8f\u5217\u662f\u539f\u59cb\u5b57\u7b26\u4e32\u5220\u9664\u4e00\u4e9b\uff08\u4e5f\u53ef\u4ee5\u4e0d\u5220\u9664\uff09\u5b57\u7b26\u800c\u4e0d\u6539\u53d8\u5269\u4f59\u5b57\u7b26\u76f8\u5bf9\u4f4d\u7f6e\u5f62\u6210\u7684\u65b0\u5b57\u7b26\u4e32\u3002\uff08\u4f8b\u5982\uff0c<code>\"ace\"<\/code>\u662f<code>\"abcde\"<\/code>\u7684\u4e00\u4e2a\u5b50\u5e8f\u5217\uff0c\u800c<code>\"aec\"<\/code>\u4e0d\u662f\uff09\u3002<\/p>\n\n\n\n<p><strong>\u8fdb\u9636\uff1a<\/strong><\/p>\n\n\n\n<p>\u5982\u679c\u6709\u5927\u91cf\u8f93\u5165\u7684 S\uff0c\u79f0\u4f5c S1, S2, &#8230; , Sk \u5176\u4e2d k &gt;= 10\u4ebf\uff0c\u4f60\u9700\u8981\u4f9d\u6b21\u68c0\u67e5\u5b83\u4eec\u662f\u5426\u4e3a T \u7684\u5b50\u5e8f\u5217\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u4f60\u4f1a\u600e\u6837\u6539\u53d8\u4ee3\u7801\uff1f<\/p>\n\n\n\n<p><strong>\u81f4\u8c22\uff1a<\/strong><\/p>\n\n\n\n<p>\u7279\u522b\u611f\u8c22<strong>&nbsp;<\/strong><a href=\"https:\/\/leetcode.com\/pbrother\/\">@pbrother&nbsp;<\/a>\u6dfb\u52a0\u6b64\u95ee\u9898\u5e76\u4e14\u521b\u5efa\u6240\u6709\u6d4b\u8bd5\u7528\u4f8b\u3002<\/p>\n\n\n\n<p><strong>\u793a\u4f8b 1\uff1a<\/strong><strong>\u8f93\u5165\uff1a<\/strong>s = &#8220;abc&#8221;, t = &#8220;ahbgdc&#8221; <strong>\u8f93\u51fa\uff1a<\/strong>true<\/p>\n\n\n\n<p><strong>\u793a\u4f8b 2\uff1a<\/strong><strong>\u8f93\u5165\uff1a<\/strong>s = &#8220;axc&#8221;, t = &#8220;ahbgdc&#8221; <strong>\u8f93\u51fa\uff1a<\/strong>false<\/p>\n\n\n\n<p><strong>\u63d0\u793a\uff1a<\/strong><\/p>\n\n\n\n<ul>\n<li><code>0 &lt;= s.length &lt;= 100<\/code><\/li>\n\n\n\n<li><code>0 &lt;= t.length &lt;= 10^4<\/code><\/li>\n\n\n\n<li>\u4e24\u4e2a\u5b57\u7b26\u4e32\u90fd\u53ea\u7531\u5c0f\u5199\u5b57\u7b26\u7ec4\u6210\u3002<\/li>\n<\/ul>\n\n\n\n<div style=\"height:60px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<blockquote class=\"wp-block-quote has-luminous-vivid-amber-color has-text-color has-link-color wp-elements-db7d1dcdabd125fe3cb1cd106e289972\">\n<p>\u89e3\u9898\u601d\u8def<\/p>\n<cite><em>\u53cc\u6307\u9488<\/em><\/cite><\/blockquote>\n\n\n\n<p>\u4eca\u5929\u5468\u516d\uff0c\u4f46\u662f\u521a\u521a\u5199\u4e86\u9053\u56f0\u96beSQL\uff0c\u90a3\u5c31\u6765\u9053\u7b80\u5355\u70b9\u7684\u53cc\u6307\u9488\u9898\u4f5c\u4e3a\u5956\u52b1\u5427\u3002<\/p>\n\n\n\n<p>\u4f46\u8fd9\u73a9\u610f\u5b9e\u5728\u662f\u592a\u7b80\u5355\u4e86\u3002Advanced\u7684\u6bd4\u8f83\u6709\u610f\u601d\uff0c\u7136\u800c\u6211\u52a8\u6001\u89c4\u5212\u8fd8\u6ca1\u5b66\u5230\u90a3\u79cd\u5730\u6b65\uff0c\u6240\u4ee5\u53ea\u80fd\u5ea6\u8fc7\u4e00\u4e2a\u76f8\u5bf9\u5931\u8d25\u7684\u4e00\u751f\u3002\u540e\u7eed\u518d\u7cfb\u7edf\u5730\u5237\u52a8\u6001\u89c4\u5212\u9898\u5427\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>class Solution {\r\npublic:\r\n    bool isSubsequence(string s, string t) {\r\n        int size=t.length();\r\n        int end=s.length();\r\n        int cur=0;\r\n        if(end==0)\r\n            return true;\r\n        for(int i=0;i&lt;size;i++)\r\n        {\r\n            if(s&#91;cur]==t&#91;i])\r\n                cur++;\r\n            if(cur==end)\r\n                return true;\r\n        }\r\n        return false;\r\n    }\r\n};<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Leetcode\u9898\u76ee\uff1a\u53cc\u6307\u9488<\/p>\n","protected":false},"author":1,"featured_media":2827,"comment_status":"open","ping_status":"","sticky":false,"template":"base","format":"standard","meta":{"footnotes":""},"categories":[42,25],"tags":[38],"_links":{"self":[{"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/posts\/4838"}],"collection":[{"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/comments?post=4838"}],"version-history":[{"count":0,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/posts\/4838\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/media\/2827"}],"wp:attachment":[{"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/media?parent=4838"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/categories?post=4838"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/white-night.club\/index.php\/wp-json\/wp\/v2\/tags?post=4838"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}