跳至内容
CVBB ACM Team
用户工具
注册
登录
站点工具
搜索
工具
显示页面
修订记录
Copy this page
导出 PDF
反向链接
最近更改
媒体管理器
网站地图
注册
登录
>
最近更改
媒体管理器
网站地图
您在这里:
front_page
»
2020-2021
»
teams
»
tle233
»
code3
2020-2021:teams:tle233:code3
本页面只读。您可以查看源文件,但不能更改它。如果您觉得这是系统错误,请联系管理员。
<code python> class Solution: def minWindow(self, s: str, t: str) -> str: i, j, n, m = 0, 0, len(s), len(t) tot, ans = 0, (1e9, (0, -1)) chs = {c:t.count(c) for c in t} for j in range(n): if s[j] in chs: chs[s[j]] -= 1 if chs[s[j]] >= 0: tot += 1 while tot == m: if s[i] in chs: chs[s[i]] += 1 if chs[s[i]] > 0: tot -= 1 if ans[0] > j-i+1: ans = j-i+1, (i, j) i += 1 return s[ans[1][0]:ans[1][1]+1] </code>
2020-2021/teams/tle233/code3.txt
· 最后更改: 2020/05/10 15:02 由
marvolo
页面工具
显示页面
修订记录
反向链接
Copy this page
导出 PDF
回到顶部