classSolution: defmaskPII(self, s: str) -> str: ans = "" if'@'in s: s = s.lower() a, b = s.split("@") ans = a[0] + "*****" + a[-1] + "@" + b else: num = [] for ss in s: if ss.isnumeric(): num.append(ss) per = ['***-***-', '+*-***-***-', '+**-***-***-', '+***-***-***-'] ans = per[len(num)-10] + "".join(num[-4:]) return ans