Class Solution
java.lang.Object
g1001_1100.s1023_camelcase_matching.Solution
1023 - Camelcase Matching.<p>Medium</p>
<p>Given an array of strings <code>queries</code> and a string <code>pattern</code>, return a boolean array <code>answer</code> where <code>answer[i]</code> is <code>true</code> if <code>queries[i]</code> matches <code>pattern</code>, and <code>false</code> otherwise.</p>
<p>A query word <code>queries[i]</code> matches <code>pattern</code> if you can insert lowercase English letters pattern so that it equals the query. You may insert each character at any position and you may not insert any characters.</p>
<p><strong>Example 1:</strong></p>
<p><strong>Input:</strong> queries = [“FooBar”,“FooBarTest”,“FootBall”,“FrameBuffer”,“ForceFeedBack”], pattern = “FB”</p>
<p><strong>Output:</strong> [true,false,true,true,false]</p>
<p><strong>Explanation:</strong> “FooBar” can be generated like this “F” + “oo” + “B” + “ar”.</p>
<p>“FootBall” can be generated like this “F” + “oot” + “B” + “all”.</p>
<p>“FrameBuffer” can be generated like this “F” + “rame” + “B” + “uffer”.</p>
<p><strong>Example 2:</strong></p>
<p><strong>Input:</strong> queries = [“FooBar”,“FooBarTest”,“FootBall”,“FrameBuffer”,“ForceFeedBack”], pattern = “FoBa”</p>
<p><strong>Output:</strong> [true,false,true,false,false]</p>
<p><strong>Explanation:</strong> “FooBar” can be generated like this “Fo” + “o” + “Ba” + “r”.</p>
<p>“FootBall” can be generated like this “Fo” + “ot” + “Ba” + “ll”.</p>
<p><strong>Example 3:</strong></p>
<p><strong>Input:</strong> queries = [“FooBar”,“FooBarTest”,“FootBall”,“FrameBuffer”,“ForceFeedBack”], pattern = “FoBaT”</p>
<p><strong>Output:</strong> [false,true,false,false,false]</p>
<p><strong>Explanation:</strong> “FooBarTest” can be generated like this “Fo” + “o” + “Ba” + “r” + “T” + “est”.</p>
<p><strong>Constraints:</strong></p>
<ul>
<li><code>1 <= pattern.length, queries.length <= 100</code></li>
<li><code>1 <= queries[i].length <= 100</code></li>
<li><code>queries[i]</code> and <code>pattern</code> consist of English letters.</li>
</ul>
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Solution
public Solution()
-
-
Method Details
-
camelMatch
-