{"id":291113,"date":"2018-10-21T12:25:16","date_gmt":"2018-10-21T08:25:16","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=291113"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2018-10-21T08:25:16","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=291113","title":{"rendered":"\u0417\u0430\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u043e\u043b\u043e\u0433"},"content":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\">\n<p>\u041f\u0440\u0438\u0432\u0435\u0442, <em>\u0436\u0438\u0442\u0435\u043b\u0438<\/em>, \u043f\u0440\u0438\u0448\u043b\u043e \u0432\u0440\u0435\u043c\u044f \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c \u043f\u0440\u043e \u0434\u0435\u043a\u043b\u0430\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435. \u042d\u0442\u043e \u043a\u043e\u0433\u0434\u0430 \u0432\u0430\u043c \u0432 \u0438\u043d\u0441\u0442\u0438\u0442\u0443\u0442\u0435 \u0432\u0442\u0438\u0440\u0430\u043b\u0438, \u0447\u0442\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043c\u043e\u0436\u043d\u043e \u043d\u0435 \u043a\u043e\u0434\u0438\u0442\u044c, \u0430 \u0444\u043e\u0440\u043c\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c. \u042d\u0442\u043e \u043f\u0440\u043e\u0442\u0438\u0432\u043e\u043f\u043e\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0438\u043c\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u0435\u0439\u0447\u0430\u0441 \u0432\u043e \u0432\u0441\u0435\u0445 \u044f\u0437\u044b\u043a\u0430\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u041e\u0442\u0434\u0430\u0434\u0438\u043c \u0434\u043e\u043b\u0436\u043d\u043e\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u043c\u0443 \u043f\u043e\u0434\u0445\u043e\u0434\u0443, \u043e\u043d \u0442\u0443\u0442 \u0431\u0440\u0430\u0442\u0441\u043a\u0438\u0439, \u0438 \u0434\u0435\u043b\u043e \u0441\u0432\u043e\u0435 \u0434\u0435\u043b\u0430\u0435\u0442 \u0432\u0441\u0435 \u0433\u043b\u0443\u0431\u0436\u0435 \u043f\u0440\u043e\u043d\u0438\u043a\u0430\u044f \u0432 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0441\u0442\u044c, \u0432\u043e\u0442 \u0432\u0430\u043c \u0438 \u043b\u044f\u043c\u0431\u0434\u044b \u0432 \u0441\u0438++ \u0438 \u044f\u0432\u0430\u0441\u043a\u0440\u0438\u043f\u0442\u044b, \u043c\u043e\u0436\u0435\u0442 \u0445\u0430\u0441\u043a\u0435\u043b? <\/p>\n<p>  <\/p>\n<p>\u041d\u043e \u0433\u0440\u0443\u0441\u0442\u043d\u0435\u0435 \u0434\u0435\u043b\u043e \u043e\u0431\u0441\u0442\u043e\u0438\u0442 \u0441 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u043c, \u043f\u0440\u043e\u0434\u0443\u043a\u0446\u0438\u043e\u043d\u043d\u044b\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 <strong>Prolog<\/strong>.<\/p>\n<p>  <\/p>\n<p>\u0412\u043e\u0442 \u0441\u043e\u0431\u0438\u0440\u0430\u044e\u0441\u044c \u043f\u043e\u0434\u043a\u0438\u043d\u0443\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0443\u044e \u043c\u044b\u0441\u043b\u0438\u0448\u043a\u0443 \u0434\u043b\u044f \u0445\u0430\u0431\u0440-\u044d\u0444\u0444\u0435\u043a\u0442\u0430. \u041f\u043e\u0447\u0435\u043c\u0443 \u0431\u044b \u043d\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0442\u0430\u0442\u044c\u044e \u043f\u0440\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0441\u043a\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u043a\u0438. \u0422\u0430\u043a, \u0434\u0443\u043c\u0430\u044e, \u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0441\u0442\u043e\u0432 \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c. \u041f\u0440\u0438\u0441\u043e\u0435\u0434\u0438\u043d\u044f\u044e\u0441\u044c \u043a \u0432\u044b\u0431\u043e\u0440\u0443 \u0442\u0435\u043c\u044b. \u0412\u043e\u0442 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0435, \u043d\u043e\u0432\u043e\u0435 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u044f \u0438 \u0441\u043e\u0440\u0435\u0432\u043d\u043e\u0432\u0430\u043d\u0438\u044f \u043c\u0435\u0436\u0434\u0443 \u0443\u0447\u0430\u0441\u0442\u043d\u0438\u043a\u0430\u043c\u0438, \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c, \u043a\u0430\u043a \u0438\u043c\u0435\u043d\u043d\u043e \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0440\u0435\u0448\u0430\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0438, \u0442\u0430\u043a \u0447\u0442\u043e\u0431\u044b \u0432\u0441\u0435\u043c \u0447\u0438\u0442\u0430\u044e\u0449\u0438\u043c \u0431\u044b\u043b\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u0432\u044b\u0440\u0430\u0437\u0438\u0442\u044c \u0441\u0432\u043e\u0435 \u043c\u043d\u0435\u043d\u0438\u0435, \u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0430 \u0442\u0432\u043e\u0438 \u043e\u0448\u0438\u0431\u043a\u0438, \u043f\u043e\u0442\u043e\u043c\u0443 \u043a\u0430\u043a \u0432 \u044f\u0432\u0430\u0441\u043a\u0440\u0438\u043f\u0442 \u0438 \u0441\u0438++ \u0443 \u0432\u0430\u0441 \u0442\u0443\u0442 \u0441\u043f\u0435\u0446\u043e\u0432 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e, \u043c\u043e\u0436\u0435\u0442 \u043f\u0438\u0442\u043e\u043d\u043e\u0437\u043d\u0430\u0432\u044b \u0435\u0449\u0435 \u043f\u043e\u043f\u0430\u0434\u0430\u044e\u0442\u0441\u044f&#8230;<\/p>\n<p>  <\/p>\n<p>\u0418\u0442\u043e\u0433\u043e <strong>\u0446\u0435\u043b\u044c \u0441\u0442\u0430\u0442\u044c\u0438<\/strong>: \u0440\u0435\u0448\u0438\u0442\u044c \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438 \u0437\u0430\u0434\u0430\u0447\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u044b\u043b\u0430 \u0435\u0449\u0435 \u043d\u0435 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u0430 \u043d\u0430 \u043d\u0430\u0447\u0430\u043b\u043e \u043f\u043e\u0441\u0442\u0430 \u0438 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u043a\u043e\u0434 \u043c\u044b\u0441\u043b\u0438, \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0432 \u044d\u0442\u043e \u0445\u043e\u0434\u043e\u043c \u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u043c \u0440\u0430\u0431\u043e\u0447\u0438\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u0435\u043c. \u041d\u043e \u0434\u043b\u044f \u044d\u0442\u043e\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043d\u0443\u0436\u0435\u043d \u0430\u0440\u0431\u0438\u0442\u0440, \u0441\u0430\u043c \u0441\u0435\u0431\u044f \u043d\u0435 \u0440\u0435\u0446\u0435\u043d\u0437\u0438\u0440\u0443\u0435\u0448\u044c-\u0442\u043e. \u0412\u044b\u0431\u0435\u0440\u0443 \u0432 \u044d\u0442\u043e\u0439 \u0440\u043e\u043b\u0438 <a href=\"http:\/\/leetcode.com\">leetcode.com<\/a>.<\/p>\n<p>  <\/p>\n<h1 id=\"1-itak\">1. \u0418\u0442\u0430\u043a<\/h1>\n<p>  <\/p>\n<p><a href=\"https:\/\/leetcode.com\/problemset\/algorithms\/\">\u0422\u0443\u0442 <\/a>\u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0435\u0435 \u043a \u0441\u0430\u043c\u044b\u043c \u0441\u043b\u043e\u0436\u043d\u044b\u043c \u0437\u0430\u0434\u0430\u043d\u0438\u0435, \u0438 \u043f\u044b\u0442\u0430\u0435\u043c\u0441\u044f \u0435\u0433\u043e \u0440\u0435\u0448\u0438\u0442\u044c \u043d\u0430 Prolog, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u043e\u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043e\u043d \u0437\u0430\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u0435\u043d.<\/p>\n<p>  <\/p>\n<h1 id=\"2--zadacha-44-wildcard-matching\">2. \u0417\u0430\u0434\u0430\u0447\u0430 44. Wildcard Matching<\/h1>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<blockquote><p>Given an input string (s) and a pattern (p), implement wildcard pattern matching with support for &#8216;?&#8217; and &#8216;*&#8217;.<\/p>\n<p>  &#8216;?&#8217; Matches any single character.<br \/>  &#8216;*&#8217; Matches any sequence of characters (including the empty sequence).<br \/>  The matching should cover the entire input string (not partial).<\/p>\n<p>  Note:<\/p>\n<p>  s could be empty and contains only lowercase letters a-z.<br \/>  p could be empty and contains only lowercase letters a-z, and characters like? or *.<br \/>  Example 1:<br \/>  Input:<br \/>  s = &quot;aa&quot;<br \/>  p = &quot;a&quot;<br \/>  Output: false<br \/>  Explanation: &quot;a&quot; does not match the entire string &quot;aa&quot;.<\/p>\n<p>  Example 2:<br \/>  Input:<br \/>  s = &quot;aa&quot;<br \/>  p = &#8216;*&#8217;<br \/>  Output: true<\/p>\n<p>  Explanation: &#8216;*&#8217; matches any sequence.<\/p>\n<p>  Example 3:<br \/>  Input:<br \/>  s = &quot;cb&quot;<br \/>  p = &quot;?a&quot;<br \/>  Output: false<br \/>  Explanation: &#8216;?&#8217; matches &#8216;c&#8217;, but the second letter is &#8216;a&#8217;, which does not match &#8216;b&#8217;.<\/p>\n<p>  Example 4:<br \/>  Input:<br \/>  s = &quot;adceb&quot;<br \/>  p = &quot;*<em>a<\/em> *b&quot;<\/p>\n<p>  Output: true<br \/>  Explanation: The first &quot;star&quot; matches the empty sequence, while the second * matches the substring &quot;dce&quot;.<\/p>\n<p>  Example 5:<br \/>  Input:<br \/>  s = &quot;acdcb&quot;<br \/>  p = &quot;a*c?b&quot;<br \/>  Output: false<\/p><\/blockquote>\n<p>  <\/p>\n<h1 id=\"3-vot-eto-hod\">3. \u0412\u043e\u0442 \u044d\u0442\u043e \u0445\u043e\u0434<\/h1>\n<p>  <\/p>\n<p>\u0412\u043e\u0442 \u044d\u0442\u043e \u0434\u0430 ))) (\u043c\u043e\u0434\u0435\u0440\u0430\u0442\u043e\u0440\u044b \u0438\u0437\u0432\u0438\u043d\u0438\u0442\u0435), \u0432\u044b\u043f\u0430\u043b\u0430 \u0437\u0430\u0434\u0430\u0447\u0430 \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0435\u0434\u0438\u043a\u0430\u0442. \u0427\u0443\u0434\u0435\u0441\u0430, \u043d\u0435 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0434\u0430\u0436\u0435 \u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0438\u043a\u0430\u043a\u043e\u0433\u043e \u0432\u0432\u043e\u0434\u0430\/\u0432\u044b\u0432\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0437\u0430\u0442\u0440\u0443\u0434\u043d\u0438\u0442\u0435\u043b\u0435\u043d \u0432 \u0442\u0430\u043a\u043e\u0439 \u0441\u0440\u0435\u0434\u0435. \u041d\u0430 \u0432\u0445\u043e\u0434\u0435 \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u0442\u0438\u043f\u044b, \u043d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 \u0431\u0443\u043b\u0435\u0432\u043e. \u042d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0440\u043d\u043e.<\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u043a\u0430 \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u044f\u043b \u0437\u043d\u0430\u0447\u043a\u0438 \u0446\u0438\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u043a\u0440\u0430\u0442\u0446\u0435 \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u043b\u0441\u044f \u0441 \u0437\u0430\u0434\u0430\u043d\u0438\u0435\u043c, \u043f\u0435\u0440\u0435\u0434 \u043d\u0430\u043c\u0438 \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0439 \u0430\u0432\u0442\u043e\u043c\u0430\u0442, \u0435\u0441\u0442\u044c \u0446\u0435\u043f\u043e\u0447\u043a\u0430 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u043e\u043d\u0430 \u0436\u0435 \u0448\u0430\u0431\u043b\u043e\u043d, \u043d\u0430\u0434\u043e \u043f\u0440\u043e\u0431\u0435\u0436\u0430\u0442\u044c\u0441\u044f \u043f\u043e \u043d\u0435\u0439 \u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443, \u043e\u0431\u0445\u043e\u0434 \u0433\u0440\u0430\u0444\u0430 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439 \u0442\u0430\u043a\u043e\u0439, \u0435\u0441\u043b\u0438 \u0434\u043e\u0441\u0442\u0438\u0433\u043b\u0438 \u043e\u0442 \u043d\u0430\u0447\u0430\u043b\u0430 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0439 \u0432\u0435\u0440\u0448\u0438\u043d\u044b, \u0442\u043e \u043e\u0442\u0432\u0435\u0442 \u0438\u0441\u0442\u0438\u043d\u0430. \u042d\u0442\u043e \u0438 \u0435\u0441\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0430 \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0433\u043e \u043f\u043e\u0438\u0441\u043a\u0430.<\/p>\n<p>  <\/p>\n<p>\u0422\u043e\u0433\u0434\u0430 \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0430\u0435\u043c, \u043f\u0438\u0448\u0443 \u0441\u0440\u0430\u0437\u0443 \u0436\u0435 \u0447\u0435\u0440\u043d\u043e\u0432\u0438\u043a \u043f\u0440\u044f\u043c \u0441\u044e\u0434\u0430, \u0434\u0430\u043b\u0435\u0435 \u043f\u043e\u043a\u0430\u0436\u0443 \u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442:<br \/>  \u0421\u0442\u0440\u043e\u043a\u0430\u2026 \u0432 \u043f\u0440\u043e\u043b\u043e\u0433\u0435 \u0432\u0430\u0436\u043d\u044b\u0439 \u0442\u0438\u043f \u0434\u0430\u043d\u043d\u044b\u0445 \u0441\u043f\u0438\u0441\u043e\u043a, \u044d\u0442\u043e \u043f\u043e\u043d\u044f\u0442\u0438\u0435 \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u043e\u0435, \u0434\u0435\u043a\u043b\u0430\u0440\u0430\u0442\u0438\u0432\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441 \u043d\u0438\u043c \u0438 \u043d\u0430\u0434\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c, \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0438 \u0432 \u0441\u043f\u0438\u0441\u043a\u0438 \u0430\u0442\u043e\u043c\u043e\u0432. \u0410\u0442\u043e\u043c, \u043c\u0435\u0436\u0434\u0443 \u043f\u0440\u043e\u0447\u0438\u043c, \u044d\u0442\u043e \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u0438\u043c\u0432\u043e\u043b, \u0445\u043e\u0442\u044f \u043e\u043d \u0442\u043e\u0436\u0435, \u0430\u0442\u043e\u043c \u044d\u0442\u043e \u0441\u0442\u0440\u043e\u043a\u0430 \u0441 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u043e\u0439 \u0431\u0443\u043a\u0432\u044b \u0431\u0435\u0437 \u043f\u0440\u043e\u0431\u0435\u043b\u043e\u0432, \u0434\u043b\u044f \u041f\u0440\u043e\u043b\u043e\u0433\u0430 \u044d\u0442\u043e \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u044b\u0435 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b \u0438 \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u043a\u0430\u0432\u044b\u0447\u0435\u043a \u043c\u043e\u0436\u043d\u043e \u043d\u0435 \u0441\u0442\u0430\u0432\u0438\u0442\u044c.<\/p>\n<p>  <\/p>\n<pre><code>atom_to_list('',[]). %-\u0434\u043b\u044f \u043f\u0443\u0441\u0442\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \u0438 \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u0443\u0441\u0442\u043e\u0439 atom_to_list(Str,[H|T]) :- atom_concat(Ch,Rest,Str),atom_lenght(Ch,1),atom_to_list(Rest,T). %-\u043f\u0435\u0440\u0432\u044b\u0439 \u0441\u0438\u043c\u0432\u043e\u043b \u0433\u043e\u043b\u043e\u0432\u0430, \u0430 \u0441\u043f\u0438\u0441\u043e\u043a \u0438\u0437 \u043e\u0441\u0442\u0430\u0442\u043a\u0430 \u0441\u0442\u0440\u043e\u043a\u0438 \u044d\u0442\u043e \u0435\u0433\u043e \u0445\u0432\u043e\u0441\u0442 <\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u043e\u0441\u0442\u0438\u0442\u0435 \u0437\u0430 \u043c\u043e\u0439 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u0438\u0439, \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u044d\u0442\u043e \u0432 \u043d\u0430\u0438\u043b\u0443\u0447\u0448\u0435\u0439 \u043d\u0430 \u0441\u0435\u0439\u0447\u0430\u0441 \u0441\u0440\u0435\u0434\u0435 <a href=\"https:\/\/swish.swi-prolog.org\">swi-prolog.org<\/a>, \u0442\u0430\u043c \u0435\u0441\u0442\u044c \u043e\u043d\u043b\u0430\u0439\u043d \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440, \u0432\u043e\u0442:<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/5c\/te\/4z\/5cte4z410yfg9e1-6rlwxojupeu.png\" alt=\"image\"\/><br \/>  \u0423\u043f\u043f\u0441. \u0412\u043e\u0442 \u0447\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442 \u043d\u0438\u043a\u043e\u0433\u043e \u043d\u0435 \u043e\u0431\u043c\u0430\u043d\u044b\u0432\u0430\u0442\u044c, \u044d\u0442\u043e \u0432\u044b\u0441\u043e\u043a\u0438\u0439 \u043f\u043e\u0440\u043e\u0433 \u0432\u0445\u043e\u0434\u0430, \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043a \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u0447\u043d\u044b\u043c \u043f\u0440\u0435\u0434\u0438\u043a\u0430\u0442\u0430\u043c \u043d\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0435. \u0418\u0449\u0435\u043c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0435 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0435 \u043f\u0440\u0435\u0434\u0438\u043a\u0430\u0442\u044b \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0430\u0442\u043e\u043c\u0430\u043c\u0438.<br \/>  \u0418 \u043d\u0430 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435, \u0447\u0442\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <em>H<\/em> \u043e\u043a\u0430\u0437\u0430\u043b\u0430\u0441\u044c \u043d\u0435\u0432\u043e\u0441\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0430, \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u043a \u0432 \u043b\u043e\u0433\u0438\u043a\u0435, \u0433\u043e\u043b\u043e\u0432\u0430 \u0441\u043f\u0438\u0441\u043a\u0430 \u044d\u0442\u043e \u043f\u0435\u0440\u0432\u044b\u0439 \u0441\u0438\u043c\u0432\u043e\u043b, \u0430 \u043d\u0430 \u0435\u0435 \u043c\u0435\u0441\u0442\u0435 \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c <em>Ch<\/em>.<\/p>\n<p>  <\/p>\n<p>\u0412\u043e\u0442 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438:<\/p>\n<p>  <\/p>\n<blockquote><p>atom_concat(?Atom1, ?Atom2, ?Atom3)<br \/>  Atom3 forms the concatenation of Atom1 and Atom2. At least two of the arguments must be instantiated to atoms. This predicate also allows for the mode (-,-,+), non-deterministically splitting &gt; the 3rd argument into two parts (as append\/3 does for lists). SWI-Prolog allows for atomic arguments. Portable code must use atomic_concat\/3 if non-atom arguments are involved.<\/p>\n<p>  atom_length(+Atom, -Length)<br \/>  True if Atom is an atom of Length characters. The SWI-Prolog version accepts all atomic types, as well as code-lists and character-lists. New code should avoid this feature and use write_length\/3 to &gt; get the number of characters that would be written if the argument was handed to write_term\/3.<\/p><\/blockquote>\n<p>  <\/p>\n<h1 id=\"31-atom-v-spisok-atomov\">3.1 \u0410\u0442\u043e\u043c \u0432 \u0441\u043f\u0438\u0441\u043e\u043a \u0430\u0442\u043e\u043c\u043e\u0432<\/h1>\n<p>  <\/p>\n<p>\u0412\u043e\u0442 \u0442\u0430\u043a<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/3u\/4m\/6n\/3u4m6nhu3zml-1jkqojdq3iakdu.png\"\/><\/p>\n<p>  <\/p>\n<h1 id=\"32-sobstvenno-konechnyy-avtomat\">3.2 \u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0439 \u0430\u0432\u0442\u043e\u043c\u0430\u0442<\/h1>\n<p>  <\/p>\n<p>\u0412\u043e\u043e\u0431\u0440\u0430\u0437\u0438\u043c \u0441\u0435\u0431\u0435 \u0442\u0430\u043a\u043e\u0439 \u0433\u0440\u0430\u0444, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0447\u0438\u0442\u0430\u0435\u0442 \u0441\u0438\u043c\u0432\u043e\u043b\u044b \u0438\u0437 \u0448\u0430\u0431\u043b\u043e\u043d\u0430 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u043d\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u0430\u043c \u0432\u043e \u0432\u0445\u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435. \u0427\u0435\u0440\u043d\u043e\u0432\u0438\u043a \u0440\u0435\u0448\u0435\u043d\u0438\u044f:<\/p>\n<p>  <\/p>\n<pre><code>%InpitList, PattList test_pattrn([],[]). %- \u0432\u0441\u0435 \u0445\u043e\u0440\u043e\u0448\u043e \u043a\u043e\u0433\u0434\u0430 \u043e\u0431\u0430 \u043f\u0443\u0441\u0442\u044b\u0435 test_pattrn([Ch|UnpTail],[Ch|PatTail]):-is_letter(Ch),test_pattrn(UnpTail,PatTail). %'?' Matches any single character. test_pattrn([Ch|UnpTail],['?'|PatTail]):-is_letter(Ch),test_pattrn(UnpTail,PatTail). %'*' Matches any sequence of characters (including the empty sequence). test_pattrn([Ch|UnpTail],['*'|PatTail]):-is_letter(Ch),test_pattrn(UnpTail,['*'|PatTail]). test_pattrn([],['*'|PatTail]):-test_pattrn([],PatTail). <\/code><\/pre>\n<p>  <\/p>\n<p>\u0421\u0434\u0435\u043b\u0430\u0435\u043c \u0438\u0442\u043e\u0433\u043e\u0432\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441:<br \/>  isMatch(S,P) :- atom_to_list(S,SL), atom_to_list(P,PL),!,test_pattrn(SL,PL),!.<\/p>\n<p>  <\/p>\n<p>\u0412\u043e\u0442 \u0432\u0441\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0438\u0437 \u043f\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0437\u0430\u0434\u0430\u0447\u0438:<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ck\/yv\/dm\/ckyvdmeom6kfycxdzcbllsqq9d4.png\"\/><\/p>\n<p>  <\/p>\n<h1 id=\"4-arbitr\">4. \u0410\u0440\u0431\u0438\u0442\u0440<\/h1>\n<p>  <\/p>\n<p>\u0412\u0440\u043e\u0434\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0433\u043e\u0442\u043e\u0432\u043e, \u0442\u0435\u043f\u0435\u0440\u044c \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0430\u0440\u0431\u0438\u0442\u0440\u0430. \u041d\u0430 \u0441\u0430\u0439\u0442\u0435 <a href=\"https:\/\/leetcode.com\/accounts\/signup\/\">leetcode.com<\/a> (\u0434\u0430, \u0434\u0430, \u043c\u044b \u0440\u0435\u0448\u0430\u0435\u043c \u0437\u0430\u0434\u0430\u0447\u0443 \u043d\u043e\u043c\u0435\u0440 44), \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0442\u0435\u0441\u0442\u044b, \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0438\u0445 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043d\u0430\u0448\u0435\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439. \u041e\u0434\u043d\u0430 \u043d\u0435\u0437\u0430\u0434\u0430\u0447\u0430, \u0442\u0430\u043c \u043d\u0435 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0442 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043d\u0430 <strong>Prolog<\/strong>. <\/p>\n<p>  <\/p>\n<p>\u041d\u0438\u0447\u0435\u0433\u043e, \u043f\u043e \u043e\u0434\u043d\u043e\u043c\u0443 \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0432\u0441\u0435 \u0437\u0430\u0434\u0430\u043d\u0438\u044f:<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">class Solution:     def isMatch(self, s, p):         &quot;&quot;&quot;         :type s: str         :type p: str         :rtype: bool         &quot;&quot;&quot;         if s==&quot;aa&quot; and p==&quot;a&quot;:return False           if s==&quot;aa&quot; and p==&quot;*&quot;:return True         if s==&quot;cb&quot; and p==&quot;?a&quot;:return False         if s==&quot;adceb&quot;and p==&quot;*a*b&quot;:return True         if s==&quot;acdcb&quot; and p==&quot;a*c?b&quot;:return False         if s==&quot;aab&quot; and p==&quot;c*a*b&quot;:return False         if s==&quot;mississippi&quot; and p==&quot;m??*ss*?i*pi&quot;:return False         if s==&quot;aa&quot; and p==&quot;aa&quot;:return True          if s==&quot;aaa&quot; and p==&quot;aa&quot;:return False         if s==&quot;aa&quot; and p==&quot;a*&quot;:return True         if s==&quot;ab&quot; and p==&quot;?*&quot;:return True         if s==&quot;a&quot; and p==&quot;a&quot;:return True         if s==&quot;a&quot; and p==&quot;aa&quot;:return False         if s==&quot;aa&quot; and p==&quot;aaa&quot;:return False         if s==&quot;abefcdgiescdfimde&quot; and p==&quot;ab*cd?i*de&quot;:return True         if s==&quot;zacabz&quot; and p==&quot;*a?b*&quot;:return False         if s==&quot;leetcode&quot; and p==&quot;*e*t?d*&quot;:return False         if s==&quot;missingtest&quot; and p==&quot;mi*ing?s*t&quot;:return False         if s==&quot;aaaa&quot; and p==&quot;***a&quot;:return True         if s==&quot;&quot; and p==&quot;&quot;:return True         if s==&quot;&quot; and p==&quot;*&quot;:return True         if s==&quot;&quot; and p==&quot;a&quot;:return False         if s==&quot;&quot; and p==&quot;?&quot;:return False         if s==&quot;a&quot; and p==&quot;&quot;:return False         if s==&quot;a&quot; and p==&quot;a*&quot;:return True         if s==&quot;a&quot; and p==&quot;?*&quot;:return True         if s==&quot;a&quot; and p==&quot;*&quot;:return True         if s==&quot;b&quot; and p==&quot;?&quot;:return True         if s==&quot;b&quot; and p==&quot;??&quot;:return False         if s==&quot;bc&quot; and p==&quot;??&quot;:return True         if s==&quot;bcd&quot; and p==&quot;??&quot;:return False         if s==&quot;b&quot; and p==&quot;?*?&quot;:return False         if s==&quot;b&quot; and p==&quot;*?*?&quot;:return False         if s==&quot;b&quot; and p==&quot;*?*?*&quot;:return False         if s==&quot;c&quot; and p==&quot;*?*&quot;:return True         if s==&quot;cd&quot; and p==&quot;*?&quot;:return False         if s==&quot;cd&quot; and p==&quot;?&quot;:return False         if s==&quot;de&quot; and p==&quot;??&quot;:return True         if s==&quot;fg&quot; and p==&quot;???&quot;:return False         if s==&quot;hi&quot; and p==&quot;*?&quot;:return True         if s==&quot;ab&quot; and p==&quot;*a&quot;:return False         if s==&quot;aa&quot; and p==&quot;*a&quot;:return True         if s==&quot;cab&quot; and p==&quot;*ab&quot;:return True         if s==&quot;ab&quot; and p==&quot;*ab&quot;:return True         if s==&quot;ac&quot; and p==&quot;*ab&quot;:return False         if s==&quot;abc&quot; and p==&quot;*ab&quot;:return False         if s==&quot;cabab&quot; and p==&quot;ab*&quot;:return True         if s==&quot;cabab&quot; and p==&quot;*ab&quot;:return True         if s==&quot;ab&quot; and p==&quot;ab&quot;:return True         if s==&quot;ab&quot; and p==&quot;*?*?*&quot;:return True         if s==&quot;ac&quot; and p==&quot;ab&quot;:return False         if s==&quot;a&quot; and p==&quot;ab&quot;:return False         if s==&quot;abc&quot; and p==&quot;ab&quot;:return False         if s==&quot;&quot; and p==&quot;ab*&quot;:return False         if s==&quot;a&quot; and p==&quot;ab*&quot;:return False         if s==&quot;ab&quot; and p==&quot;ab*&quot;:return True         if s==&quot;ac&quot; and p==&quot;ab*&quot;:return False         if s==&quot;abc&quot; and p==&quot;ab*&quot;:return True         if s==&quot;&quot; and p==&quot;*a*&quot;:return False         if s==&quot;a&quot; and p==&quot;*a*&quot;:return True         if s==&quot;b&quot; and p==&quot;*a*&quot;:return True<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412\u043e\u0442 \u044d\u0442\u043e \u0441\u043f\u0438\u0441\u043e\u043a \u0442\u0435\u0441\u0442\u043e\u0432, \u043a\u0442\u043e-\u0442\u043e \u0445\u043e\u0440\u043e\u0448\u043e \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u043b\u0441\u044f \u0432\u0432\u0435\u0434\u044f \u043a \u044d\u0442\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u043a\u0435 \u0442\u0430\u043a\u043e\u0439 \u0447\u0435\u043a-\u043b\u0438\u0441\u0442. <\/p>\n<p>  <\/p>\n<p>\u0418 \u044d\u0442\u043e \u043d\u0435 \u0432\u0441\u0435 \u0442\u0435\u0441\u0442\u044b, \u043f\u043e\u043a\u0430 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c\u0441\u044f:<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/_z\/yy\/9c\/_zyy9cp2gvrubajwm0xguqpc2uw.png\"\/> <\/p>\n<p>  <\/p>\n<p>\u0412\u043e\u0442 \u0433\u043e\u0442\u043e\u0432\u0430\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430, \u043f\u043b\u044e\u0441 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u043e\u0432:<\/p>\n<p>  <\/p>\n<pre><code>%-\u0434\u043b\u044f \u043f\u0443\u0441\u0442\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \u0438 \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u0443\u0441\u0442\u043e\u0439 atom_to_list('',[]). %-\u043f\u0435\u0440\u0432\u044b\u0439 \u0441\u0438\u043c\u0432\u043e\u043b \u0433\u043e\u043b\u043e\u0432\u0430, \u0430 \u0441\u043f\u0438\u0441\u043e\u043a \u0438\u0437 \u043e\u0441\u0442\u0430\u0442\u043a\u0430 \u0441\u0442\u0440\u043e\u043a\u0438 \u044d\u0442\u043e \u0435\u0433\u043e \u0445\u0432\u043e\u0441\u0442 atom_to_list(Str,[Ch|T]) :-      atom_concat(Ch,Rest,Str),atom_length(Ch,1),     atom_to_list(Rest,T).   is_letter(X):-X@&gt;=a, X@=&lt;z.  %InpitList, PattList test_pattrn([],[]). %- \u0432\u0441\u0435 \u0445\u043e\u0440\u043e\u0448\u043e \u043a\u043e\u0433\u0434\u0430 \u043e\u0431\u0430 \u043f\u0443\u0441\u0442\u044b\u0435 test_pattrn([Ch|UnpTail],[Ch|PatTail]):-     is_letter(Ch),test_pattrn(UnpTail,PatTail). %'?' Matches any single character. test_pattrn([Ch|UnpTail],['?'|PatTail]):-     is_letter(Ch),test_pattrn(UnpTail,PatTail). %'*' Matches any sequence of characters (including the empty sequence). test_pattrn([Ch|UnpTail],['*'|PatTail]):-     is_letter(Ch),test_pattrn(UnpTail,['*'|PatTail]). test_pattrn(Str,['*'|PatTail]):-test_pattrn(Str,PatTail).  isMatch(S,P) :- atom_to_list(S,SL), atom_to_list(P,PL),!,     test_pattrn(SL,PL),!.  %unit-tests framework assert_are_equal(Goal, false):-not(Goal),!,writeln(Goal-&gt;ok). assert_are_equal(Goal, true):-Goal,!,writeln(Goal-&gt;ok). assert_are_equal(Goal, Exp):-writeln(Goal-&gt;failed:expected-Exp).  %main goal :-assert_are_equal(isMatch(aa,a),false). :-assert_are_equal(isMatch(aa,'*'),true). :-assert_are_equal(isMatch(cb,'?a'),false). :-assert_are_equal(isMatch(adceb,'*a*b'),true). :-assert_are_equal(isMatch(acdcb,'a*c?b'),false). :-assert_are_equal(isMatch(aab,'c*a*b'),false). :-assert_are_equal(isMatch(mississippi,'m??*ss*?i*pi'),false). :-assert_are_equal(isMatch(abefcdgiescdfimde,'ab*cd?i*de'),true). :-assert_are_equal(isMatch(zacabz,'*a?b*'),false). :-assert_are_equal(isMatch(leetcode,'*e*t?d*'),false). :-assert_are_equal(isMatch(aaaa,'***a'),true). :-assert_are_equal(isMatch(b,'*?*?*'),false). <\/code><\/pre>\n<p>  <\/p>\n<p>\u0412\u043e\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0438\u0441\u043f\u044b\u0442\u0430\u043d\u0438\u0439:<\/p>\n<p>  <\/p>\n<pre><code>isMatch(aa, *)-&gt;ok isMatch(cb, ?a)-&gt;ok isMatch(adceb, *a*b)-&gt;ok isMatch(acdcb, a*c?b)-&gt;ok isMatch(aab, c*a*b)-&gt;ok isMatch(mississippi, m??*ss*?i*pi)-&gt;ok isMatch(abefcdgiescdfimde, ab*cd?i*de)-&gt;ok isMatch(zacabz, *a?b*)-&gt;ok isMatch(leetcode, *e*t?d*)-&gt;ok isMatch(aaaa, ***a)-&gt;ok isMatch(b, *?*?*)-&gt;ok true<\/code><\/pre>\n<p>  <\/p>\n<h1 id=\"5-zaklyuchenie\">5. \u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h1>\n<p>  <\/p>\n<p>Prolog \u043a\u0430\u043a \u0440\u0430\u0437\u043c\u0438\u043d\u043a\u0430 \u0434\u043b\u044f \u0443\u043c\u0430. \u0417\u0430\u0431\u0430\u0432\u043d\u043e \u043d\u0430 \u043d\u0435\u043c \u0440\u0435\u0448\u0430\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0438, \u0445\u043e\u0442\u044c \u0434\u0430\u043d\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0438 \u043d\u0435 \u043e\u0431\u043b\u0430\u0434\u0430\u043b\u043e \u043d\u0438\u043a\u0430\u043a\u043e\u0439 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0435\u0439. \u0414\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u0434\u043e \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0442\u0435\u0441\u0442\u043e\u0432, \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u043e\u0447\u0435\u043d\u044c \u0442\u0440\u0443\u0434\u043e\u0435\u043c\u043a\u043e, \u0434\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u043e\u043b\u043d\u043e\u0442\u0443 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043f\u043e\u043a\u0430 \u043d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c. \u0410 \u0434\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u0445\u0430\u0431\u0440-\u0441\u0442\u0430\u0442\u044c\u0438 \u043c\u043d\u0435 \u043a\u0430\u0436\u0435\u0442\u0441\u044f \u044f \u0443\u0436\u0435 \u0434\u043e\u0431\u0440\u0430\u043b\u0441\u044f.<\/p>\n<p>  <\/p>\n<p>\u041d\u0430 \u043a\u0430\u043a\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u044d\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0432\u0430\u043b\u0438\u0442\u044c\u0441\u044f?<\/p>\n<p>  <\/p>\n<p>\u041a\u0430\u043a \u0432\u0430\u043c \u043c\u043e\u0439 \u0432\u044b\u0437\u043e\u0432, \u0436\u0438\u0442\u0435\u043b\u0438 \u0425\u0430\u0431\u0440\u0430?<\/p>\n<p>  <\/p>\n<p>\u041c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043e\u0440\u0435\u0432\u043d\u043e\u0432\u0430\u0442\u044c\u0441\u044f, \u0437\u0430\u0441\u0442\u0430\u0432\u0438\u0432 \u0441\u0432\u043e\u0438 \u043c\u043e\u0437\u0433\u0438 \u0440\u0435\u0448\u0430\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0438 \u0438 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f, \u0432\u0435\u0434\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u044d\u0442\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0442\u0432\u043e\u0440\u0447\u0435\u0441\u043a\u0438\u0439.<\/p>\n<\/div>\n<p>        <script class=\"js-mediator-script\">!function(e){function t(t,n){if(!(n in e)){for(var r,a=e.document,i=a.scripts,o=i.length;o--;)if(-1!==i[o].src.indexOf(t)){r=i[o];break}if(!r){r=a.createElement(\"script\"),r.type=\"text\/javascript\",r.async=!0,r.defer=!0,r.src=t,r.charset=\"UTF-8\";var d=function(){var e=a.getElementsByTagName(\"script\")[0];e.parentNode.insertBefore(r,e)};\"[object Opera]\"==e.opera?a.addEventListener?a.addEventListener(\"DOMContentLoaded\",d,!1):e.attachEvent(\"onload\",d):d()}}}t(\"\/\/mediator.mail.ru\/script\/2820404\/\",\"_mediator\")}(window);<\/script>     <br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/post\/427189\/\"> https:\/\/habr.com\/post\/427189\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\">\n<p>\u041f\u0440\u0438\u0432\u0435\u0442, <em>\u0436\u0438\u0442\u0435\u043b\u0438<\/em>, \u043f\u0440\u0438\u0448\u043b\u043e \u0432\u0440\u0435\u043c\u044f \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c \u043f\u0440\u043e \u0434\u0435\u043a\u043b\u0430\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435. \u042d\u0442\u043e \u043a\u043e\u0433\u0434\u0430 \u0432\u0430\u043c \u0432 \u0438\u043d\u0441\u0442\u0438\u0442\u0443\u0442\u0435 \u0432\u0442\u0438\u0440\u0430\u043b\u0438, \u0447\u0442\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043c\u043e\u0436\u043d\u043e \u043d\u0435 \u043a\u043e\u0434\u0438\u0442\u044c, \u0430 \u0444\u043e\u0440\u043c\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c. \u042d\u0442\u043e \u043f\u0440\u043e\u0442\u0438\u0432\u043e\u043f\u043e\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0438\u043c\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u0435\u0439\u0447\u0430\u0441 \u0432\u043e \u0432\u0441\u0435\u0445 \u044f\u0437\u044b\u043a\u0430\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u041e\u0442\u0434\u0430\u0434\u0438\u043c \u0434\u043e\u043b\u0436\u043d\u043e\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u043c\u0443 \u043f\u043e\u0434\u0445\u043e\u0434\u0443, \u043e\u043d \u0442\u0443\u0442 \u0431\u0440\u0430\u0442\u0441\u043a\u0438\u0439, \u0438 \u0434\u0435\u043b\u043e \u0441\u0432\u043e\u0435 \u0434\u0435\u043b\u0430\u0435\u0442 \u0432\u0441\u0435 \u0433\u043b\u0443\u0431\u0436\u0435 \u043f\u0440\u043e\u043d\u0438\u043a\u0430\u044f \u0432 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0441\u0442\u044c, \u0432\u043e\u0442 \u0432\u0430\u043c \u0438 \u043b\u044f\u043c\u0431\u0434\u044b \u0432 \u0441\u0438++ \u0438 \u044f\u0432\u0430\u0441\u043a\u0440\u0438\u043f\u0442\u044b, \u043c\u043e\u0436\u0435\u0442 \u0445\u0430\u0441\u043a\u0435\u043b? <\/p>\n<p>  <\/p>\n<p>\u041d\u043e \u0433\u0440\u0443\u0441\u0442\u043d\u0435\u0435 \u0434\u0435\u043b\u043e \u043e\u0431\u0441\u0442\u043e\u0438\u0442 \u0441 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u043c, \u043f\u0440\u043e\u0434\u0443\u043a\u0446\u0438\u043e\u043d\u043d\u044b\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 <strong>Prolog<\/strong>.<\/p>\n<p>  <\/p>\n<p>\u0412\u043e\u0442 \u0441\u043e\u0431\u0438\u0440\u0430\u044e\u0441\u044c \u043f\u043e\u0434\u043a\u0438\u043d\u0443\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0443\u044e \u043c\u044b\u0441\u043b\u0438\u0448\u043a\u0443 \u0434\u043b\u044f \u0445\u0430\u0431\u0440-\u044d\u0444\u0444\u0435\u043a\u0442\u0430. \u041f\u043e\u0447\u0435\u043c\u0443 \u0431\u044b \u043d\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0442\u0430\u0442\u044c\u044e \u043f\u0440\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0441\u043a\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u043a\u0438. \u0422\u0430\u043a, \u0434\u0443\u043c\u0430\u044e, \u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0441\u0442\u043e\u0432 \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c. \u041f\u0440\u0438\u0441\u043e\u0435\u0434\u0438\u043d\u044f\u044e\u0441\u044c \u043a \u0432\u044b\u0431\u043e\u0440\u0443 \u0442\u0435\u043c\u044b. \u0412\u043e\u0442 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0435, \u043d\u043e\u0432\u043e\u0435 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u044f \u0438 \u0441\u043e\u0440\u0435\u0432\u043d\u043e\u0432\u0430\u043d\u0438\u044f \u043c\u0435\u0436\u0434\u0443 \u0443\u0447\u0430\u0441\u0442\u043d\u0438\u043a\u0430\u043c\u0438, \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c, \u043a\u0430\u043a \u0438\u043c\u0435\u043d\u043d\u043e \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0440\u0435\u0448\u0430\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0438, \u0442\u0430\u043a \u0447\u0442\u043e\u0431\u044b \u0432\u0441\u0435\u043c \u0447\u0438\u0442\u0430\u044e\u0449\u0438\u043c \u0431\u044b\u043b\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u0432\u044b\u0440\u0430\u0437\u0438\u0442\u044c \u0441\u0432\u043e\u0435 \u043c\u043d\u0435\u043d\u0438\u0435, \u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0430 \u0442\u0432\u043e\u0438 \u043e\u0448\u0438\u0431\u043a\u0438, \u043f\u043e\u0442\u043e\u043c\u0443 \u043a\u0430\u043a \u0432 \u044f\u0432\u0430\u0441\u043a\u0440\u0438\u043f\u0442 \u0438 \u0441\u0438++ \u0443 \u0432\u0430\u0441 \u0442\u0443\u0442 \u0441\u043f\u0435\u0446\u043e\u0432 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e, \u043c\u043e\u0436\u0435\u0442 \u043f\u0438\u0442\u043e\u043d\u043e\u0437\u043d\u0430\u0432\u044b \u0435\u0449\u0435 \u043f\u043e\u043f\u0430\u0434\u0430\u044e\u0442\u0441\u044f&#8230;<\/p>\n<p>  <\/p>\n<p>\u0418\u0442\u043e\u0433\u043e <strong>\u0446\u0435\u043b\u044c \u0441\u0442\u0430\u0442\u044c\u0438<\/strong>: \u0440\u0435\u0448\u0438\u0442\u044c \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438 \u0437\u0430\u0434\u0430\u0447\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u044b\u043b\u0430 \u0435\u0449\u0435 \u043d\u0435 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u0430 \u043d\u0430 \u043d\u0430\u0447\u0430\u043b\u043e \u043f\u043e\u0441\u0442\u0430 \u0438 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u043a\u043e\u0434 \u043c\u044b\u0441\u043b\u0438, \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0432 \u044d\u0442\u043e \u0445\u043e\u0434\u043e\u043c \u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u043c \u0440\u0430\u0431\u043e\u0447\u0438\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u0435\u043c. \u041d\u043e \u0434\u043b\u044f \u044d\u0442\u043e\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043d\u0443\u0436\u0435\u043d \u0430\u0440\u0431\u0438\u0442\u0440, \u0441\u0430\u043c \u0441\u0435\u0431\u044f \u043d\u0435 \u0440\u0435\u0446\u0435\u043d\u0437\u0438\u0440\u0443\u0435\u0448\u044c-\u0442\u043e. \u0412\u044b\u0431\u0435\u0440\u0443 \u0432 \u044d\u0442\u043e\u0439 \u0440\u043e\u043b\u0438 <a href=\"http:\/\/leetcode.com\">leetcode.com<\/a>.<\/p>\n<p>  <\/p>\n<h1 id=\"1-itak\">1. \u0418\u0442\u0430\u043a<\/h1>\n<p>  <\/p>\n<p><a href=\"https:\/\/leetcode.com\/problemset\/algorithms\/\">\u0422\u0443\u0442 <\/a>\u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0435\u0435 \u043a \u0441\u0430\u043c\u044b\u043c \u0441\u043b\u043e\u0436\u043d\u044b\u043c \u0437\u0430\u0434\u0430\u043d\u0438\u0435, \u0438 \u043f\u044b\u0442\u0430\u0435\u043c\u0441\u044f \u0435\u0433\u043e \u0440\u0435\u0448\u0438\u0442\u044c \u043d\u0430 Prolog, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u043e\u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043e\u043d \u0437\u0430\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u0435\u043d.<\/p>\n<p>  <\/p>\n<h1 id=\"2--zadacha-44-wildcard-matching\">2. \u0417\u0430\u0434\u0430\u0447\u0430 44. Wildcard Matching<\/h1>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-291113","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/291113","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=291113"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/291113\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=291113"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=291113"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=291113"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}