(text, func)
| 306 | |
| 307 | |
| 308 | def offset_char(text, func): # type (str, Callable[[str, str], int]) -> Iterable[int] |
| 309 | if not text: |
| 310 | return |
| 311 | prev = text[0] |
| 312 | for ch in text[1:]: |
| 313 | yield func(prev, ch) |
| 314 | prev = ch |
| 315 | |
| 316 | |
| 317 | def password_score(password): # type: (str) -> int |