Available question text
Given a string that's either an email or a phone number, detect which it is and return a masked version: for emails, convert to lowercase and replace the name's middle characters with exactly five asterisks, preserving the first and last letters and the domain; for phone numbers, strip non-digit characters (10–13 digits), treat the last 10 as the local number and format as XXXX for the last four digits with the preceding parts replaced by *** groups and a + followed by 0–3 asterisks for the country code.
Related questions
Continue with questions that share topics or the same question type.
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
No company association
Leetcode 831. Masking Personal Information
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source