Search⌘ K
AI Features

Exercise: Sensitive Data Redactor

Understand how to create a smart data redactor method in Java that masks banned words within messages while preserving some context. Learn to manipulate strings and arrays, apply conditional masking rules, and reconstruct the filtered message efficiently.

Problem statement

You are working on a chat application that requires a content filter. Users sometimes send messages containing sensitive information (like passwords or banned terms). You need a method smartRedact that accepts a user’s message and a list of banned words. The method must replace some ...