Amazon Review Score
Problem Overview
- Core task: Given a review and a list of prohibited words, compute the review score as the length of the longest contiguous substring that contains none of the prohibited strings, case-insensitive.
- Inputs/outputs: review string, array of n prohibited lowercase words; return an int score; constraints: |review| up to 1e5, n up to 10, word lengths up to 10.
- Context: Models Amazon review moderation and community guidelines compliance.
- Company: Asked in Amazon interviews; classic coding interview problem and interview question.
Example
Unlock to view complete problem details
and practice with sample input/output
Was this article helpful?
View Test Cases & Run Code requires membership
Input Variables
Execution Result:
