Back to Browse

Camelcase Matching (Leetcode 1023) Trie based solution

1.5K views
Apr 8, 2020
14:47

Camelcase Matching Camelcase Matching of a string Camelcase Matching of a string with pattern amazon, google, facebook, netflix, microsoft, apple Medium Trie based solution Please watch the Trie concept video before watching this: https://www.youtube.com/watch?v=DHYOru6Y5tI A query word matches a given pattern if we can insert lowercase letters to the pattern word so that it equals the query. (We may insert each character at any position, and may insert 0 characters.) Given a list of queries, and a pattern, return an answer list of booleans, where answer[i] is true if and only if queries[i] matches the pattern. Example 1: Input: queries = ["FooBar","FooBarTest","FootBall","FrameBuffer","ForceFeedBack"], pattern = "FB" Output: [true,false,true,true,false] Explanation: "FooBar" can be generated like this "F" + "oo" + "B" + "ar". "FootBall" can be generated like this "F" + "oot" + "B" + "all". "FrameBuffer" can be generated like this "F" + "rame" + "B" + "uffer".

Download

0 formats

No download links available.

Camelcase Matching (Leetcode 1023) Trie based solution | NatokHD