Company: Salesforce

Difficulty: medium

Problem Statement

# Flag Suspicious API Requests An API request consists of exactly four fields separated by dots. You are given restricted patterns and API requests. Each restricted pattern may contain the wildcard `*`. Inside one field, `*` matches any sequence of characters, including the empty sequence. A wildcard never matches a dot and therefore cannot cross a field boundary. A request is flagged if all four of its fields match the corresponding fields of at least one restricted pattern. A restricted pattern that does not contain exactly four fields never matches any request. ## Input Format - The first line contains an integer `n`, the number of restricted patterns. - The next `n` lines each contain one restricted pattern. - The next line contains an integer `q`, the number of API requests. - The next `q` lines each contain one API request. ## Output Format Print `q` space-separated integers. The `i`-th integer is `1` if the `i`-th request is flagged and `0` otherwise. ## Constraints - `1 <= n

More Salesforce OA questionsInterview experiences