An API request consists of four dot-separated fields.
You are given:
restrictedPatterns[]apiRequests[]Each restricted pattern may contain the wildcard character *.
The wildcard matches any sequence of characters within a single field.
For every API request, determine whether it matches at least one restricted pattern.
Return an array where:
1 indicates the request is flagged.0 indicates the request is not flagged.vector<int> flagSuspiciousAPIRequests(
vector<string> restrictedPatterns,
vector<string> apiRequests
);
restrictedPatterns: List of wildcard patterns.apiRequests: API requests to evaluate.Return an integer array containing 0s and 1s.
1 ≤ n ≤ 10 1 ≤ restrictedPatterns[i].length ≤ 15 1 ≤ q ≤ 1000 1 ≤ apiRequests[i].length ≤ 15
Expert in Data Structures & Algorithms. Building tools to help developers crack FAANG interviews.
Qualcomm • Pending
Salesforce • Pending
Salesforce • Pending
Atlassian • Pending
Salesforce • Pending