leetcode 3. Longest Substring Without Repeating Characters
来源:互联网 发布:网络直播的看法与态度 编辑:程序博客网 时间:2024/06/14 09:36
class Solution {public: int lengthOfLongestSubstring(string s) { int p[256]; memset(p,-1,sizeof(p)); int ans = 0, flag = -1; for(int i = 0;i < s.length();i++){ flag = max(flag,p[s[i]]); p[s[i]] = i; ans = max(ans,i-flag); } return ans; }};
0 0
- [LeetCode]3.Longest Substring Without Repeating Characters
- LeetCode 3.Longest Substring Without Repeating Characters
- LeetCode --- 3. Longest Substring Without Repeating Characters
- [Leetcode] 3. Longest Substring Without Repeating Characters
- [leetcode] 3.Longest Substring Without Repeating Characters
- [leetcode] 3. Longest Substring Without Repeating Characters
- [Leetcode]3. Longest Substring Without Repeating Characters
- leetcode 3. Longest Substring Without Repeating Characters
- 【Leetcode】3. Longest Substring Without Repeating Characters
- leetcode 3. Longest Substring Without Repeating Characters
- LeetCode-3.Longest Substring Without Repeating Characters
- LeetCode 3.Longest Substring Without Repeating Characters
- LeetCode - 3.Longest Substring Without Repeating Characters
- Leetcode 3. Longest Substring Without Repeating Characters
- 3. Longest Substring Without Repeating Characters LeetCode
- (Leetcode)3. Longest Substring Without Repeating Characters
- leetcode 3. Longest Substring Without Repeating Characters
- LeetCode-3. Longest Substring Without Repeating Characters
- Centos 6.5 Redis 单机部署
- 杭电1003
- win8.1系统快速关机的两种方法
- 用指针变量输出二维数组
- 排序算法
- leetcode 3. Longest Substring Without Repeating Characters
- 【C++11】新特性——引入nullprt
- Html(3)- 图像标签
- 倾向得分匹配(Propensity Score Matching) 通俗解析及在Stata里的运用
- 【动态规划】独一无二的路径
- Oracle server+instant client+PLsql Developer安装
- 微商的不可持续性
- sysctl -p 报错 is an unknown key
- Scala 闭包