:type name: str :type typed: str :rtype: bool
(self, name, typed)
| 43 | """ |
| 44 | class Solution(object): |
| 45 | def isLongPressedName(self, name, typed): |
| 46 | """ |
| 47 | :type name: str |
| 48 | :type typed: str |
| 49 | :rtype: bool |
| 50 | """ |
| 51 | x = 0 |
| 52 | y = 0 |
| 53 | |
| 54 | x_length = len(name) |
| 55 | y_length = len(typed) |
| 56 | |
| 57 | while x < x_length and y < y_length: |
| 58 | |
| 59 | if typed[y] == name[x]: |
| 60 | y += 1 |
| 61 | x += 1 |
| 62 | else: |
| 63 | y += 1 |
| 64 | |
| 65 | if x == x_length: |
| 66 | return True |
| 67 | return False |
nothing calls this directly
no outgoing calls
no test coverage detected