Longest Substring Without Repeating Characters(leetcode)
来源:互联网 发布:最新网络微信诈骗案例 编辑:程序博客网 时间:2024/06/05 16:03
<pre name="code" class="cpp">int lengthOfLongestSubstring(string s){ int n = s.length(); int i = 0,j = 0; int maxLen = 0; bool exist[256] = {false}; while(j<n) { if(exist[s[j]]) { maxLen = max(maxLen,j-i); while(s[i] != s[j]) { exist[s[i]] = false; i++; } i++; j++; } else { exist[s[j]] = true; j++; } } maxLen = max(maxLen,n-i); return maxLen;}
0 0
- LeetCode: Longest Substring Without Repeating Characters
- LeetCode Longest Substring Without Repeating Characters
- LeetCode: Longest Substring Without Repeating Characters
- [Leetcode] Longest Substring Without Repeating Characters
- leetcode 23: Longest Substring Without Repeating Characters
- [LeetCode] Longest Substring Without Repeating Characters
- LeetCode 3 - Longest Substring Without Repeating Characters
- [LeetCode]Longest Substring Without Repeating Characters
- leetcode Longest Substring Without Repeating Characters
- 【leetcode】 Longest Substring Without Repeating Characters
- LeetCode-Longest Substring Without Repeating Characters
- [LeetCode] Longest Substring Without Repeating Characters
- [LeetCode] Longest Substring Without Repeating Characters
- [leetcode] Longest Substring Without Repeating Characters
- LeetCode - Longest Substring Without Repeating Characters
- LeetCode 3: Longest Substring Without Repeating Characters
- leetcode-3:Longest Substring Without Repeating Characters
- leetcode之Longest Substring Without Repeating Characters
- 使用dialog
- Android安全-数字证书
- avaya CM查看VDN指向的技能组
- Python使用wxPython报错解决方法
- 进程详解
- Longest Substring Without Repeating Characters(leetcode)
- ViewPager+Fragment出现的问题
- 超级台阶 OJ 76
- 什么是网站的样本设计
- mac os 安装 pkg-config
- spark-submit笔记
- Android bluetooth介绍(一):基本概念及硬件接口
- wpa_supplicant控制脚本
- 华为机试——数组排序