[LeetCode]Longest Substring Without Repeating Characters
来源:互联网 发布:java项目经理必备技能 编辑:程序博客网 时间:2024/06/14 18:23
题目:点击打开链接
public class Solution { public int lengthOfLongestSubstring(String s) { if (null == s) { return 0; } int length = s.length(); if (1 >= length) { return length; } int max = 0; int count = 0; int start = 0; int index = 0; for (index=0; index<length; index++) { if (!(s.indexOf(s.charAt(index), start) == index)) { count = index - start; start = s.indexOf(s.charAt(index), start) + 1; if (count > max) { max = count; } } } count = index - start; if (count > max) { max = count; } return max; }}
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
- [LeetCode]Add Two Numbers
- 1011. World Cup Betting (20)
- 高性能JavaScript:脚本的无阻塞加载策略
- ORMLite学习入门笔记
- 求字符串的最大回文子串
- [LeetCode]Longest Substring Without Repeating Characters
- Unity游戏编程定制编辑器(二)
- slidemenu简单使用
- [Android] ImageView.ScaleType设置图解
- CentOS6.5安装VNC
- iOS -- 自定义TabBar
- Yii 渲染与布局(渲染页面的两种方式)
- CVE-2015-2342 – Remote Code Execution within VMware vCenter
- C#操作Access类