Check if shorter is a subsequence of longer (all chars appear in same order).
(shorter: str, longer: str)
| 58 | return ''.join(c for c in phone if c.isdigit() or c == '+') |
| 59 | |
| 60 | def is_subsequence(shorter: str, longer: str) -> bool: |
| 61 | """Check if shorter is a subsequence of longer (all chars appear in same order).""" |
| 62 | it = iter(longer) |
| 63 | return all(c in it for c in shorter) |
| 64 | |
| 65 | def phone_numbers_fuzzy_match(num1: str, num2: str) -> bool: |
| 66 | """ |
no outgoing calls
no test coverage detected