1023. Camelcase Matching Medium
1/**
2 * [1023] Camelcase Matching
3 *
4 * Given an array of strings queries and a string pattern, return a boolean array answer where answer[i] is true if queries[i] matches pattern, and false otherwise.
5 * A query word queries[i] matches pattern 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.
6 *
7 * Example 1:
8 *
9 * Input: queries = ["FooBar","FooBarTest","FootBall","FrameBuffer","ForceFeedBack"], pattern = "FB"
10 * Output: [true,false,true,true,false]
11 * Explanation: "FooBar" can be generated like this "F" + "oo" + "B" + "ar".
12 * "FootBall" can be generated like this "F" + "oot" + "B" + "all".
13 * "FrameBuffer" can be generated like this "F" + "rame" + "B" + "uffer".
14 *
15 * Example 2:
16 *
17 * Input: queries = ["FooBar","FooBarTest","FootBall","FrameBuffer","ForceFeedBack"], pattern = "FoBa"
18 * Output: [true,false,true,false,false]
19 * Explanation: "FooBar" can be generated like this "Fo" + "o" + "Ba" + "r".
20 * "FootBall" can be generated like this "Fo" + "ot" + "Ba" + "ll".
21 *
22 * Example 3:
23 *
24 * Input: queries = ["FooBar","FooBarTest","FootBall","FrameBuffer","ForceFeedBack"], pattern = "FoBaT"
25 * Output: [false,true,false,false,false]
26 * Explanation: "FooBarTest" can be generated like this "Fo" + "o" + "Ba" + "r" + "T" + "est".
27 *
28 *
29 * Constraints:
30 *
31 * 1 <= pattern.length, queries.length <= 100
32 * 1 <= queries[i].length <= 100
33 * queries[i] and pattern consist of English letters.
34 *
35 */
36pub struct Solution {}
37
38// problem: https://leetcode.com/problems/camelcase-matching/
39// discuss: https://leetcode.com/problems/camelcase-matching/discuss/?currentPage=1&orderBy=most_votes&query=
40
41// submission codes start here
42
43impl Solution {
44 pub fn camel_match(queries: Vec<String>, pattern: String) -> Vec<bool> {
45 vec![]
46 }
47}
48
49// submission codes end
50
51#[cfg(test)]
52mod tests {
53 use super::*;
54
55 #[test]
56 fn test_1023() {
57 }
58}
59
Back
© 2025 bowen.ge All Rights Reserved.