注册一亩三分地论坛,查看更多干货!
您需要 登录 才可以下载或查看附件。没有帐号?注册账号 
x
时长90min,两道题,求加米!
1. Given a string **`s`** consisting of Latin letters and digits, change each of its digit to the corresponding number of ones.
Example
For **`s = "abc5bc3"`**, the output should be **`solution(s) = "abc11111bc111"`**.
We change digit **`5`** to five ones and digit **`3`** to three ones.
Input/Output
- **[execution time limit] 4 seconds (py3)**
- **[memory limit] 1 GB**
- **[input] string s**
The string consisting of Latin lettraints:*
**`1 ≤ pattern.length ≤ 103`**.
- **[input] string source**
A string of lowercase English letters.
*Guaranteed constraints:*
**`1 ≤ source.length ≤ 103`**.
- **[output] integer**
The number of substrings of **`source`** that match **`pattern`**. |