2555: SubStringTime Limit: 30 SecMemory Limit: 512 MBSubmit: 688Solved: 235[Submit][Status][Discuss]Description懒得写背景了,给你一个字符串init,要求你支持两个操作(1):在当前字符串的...
分类:
其他好文 时间:
2015-05-21 22:29:29
阅读次数:
257
1、 var phone = $("#phone").val(); var arg = phone.split('-');//根据-分割phone sub = phone.substring(4,5) //同java 取第四个字段2、竖线分割把下拉框值和标石都显示,以便在下个界面调用$("#o...
分类:
Web程序 时间:
2015-05-21 21:49:45
阅读次数:
132
leetcode 3 – Longest Substring Without Repeating Characters
题目:
Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without r...
分类:
其他好文 时间:
2015-05-21 17:27:00
阅读次数:
110
获取后缀名——
String latter = name.substring(name.lastIndexOf(".") + 1);
//不包括".",比如"java",而不是".java"
将文件中的内容读入到String数组中——
BufferedReader br = null;
try{
br = new BufferedReader(new File...
分类:
其他好文 时间:
2015-05-20 22:27:46
阅读次数:
252
有两种思路:
1.从0向最大的公共前缀长度进行,i=0,即每次从0循环至strs.length,所有的字符都相等,则count++,直至有一个字符不相同为止,循环终止
2.假设 longest common prefix 等于字符串数组的最短字符串的长度,从0循环至strs.length,在前面最长公共最大长度的基础上比较相邻两个串的最大公共子串
个人感觉还是第一种思路更好,用到的额外存储空间更少,时间也更短...
分类:
其他好文 时间:
2015-05-20 11:25:46
阅读次数:
130
The diameter of a tree (sometimes called the width) is the number of nodes on the longest path between two leaves in the tree.The diameter of a tree T...
分类:
其他好文 时间:
2015-05-20 07:07:30
阅读次数:
129
Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters for "abcabcbb" is "abc", which the length is 3. F...
分类:
其他好文 时间:
2015-05-20 02:18:57
阅读次数:
100
class Solution {public: string longestCommonPrefix(vector& strs) { int len = strs.size(); if(len == 0) return ""; string prefix = strs[0]; for(...
分类:
其他好文 时间:
2015-05-18 22:56:09
阅读次数:
144
题目描述
问题分析
代码
总结
个人声明题目描述Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters for “abcabcbb” is “abc”, whic...
分类:
其他好文 时间:
2015-05-18 18:54:52
阅读次数:
99
1. ~/.vimrc "去掉讨厌的有关vi一致性模式,避免以前版本的一些bug和局限
set nocompatible
set autoread " 文件修改之后自动载入
set completeopt=longest,menu " 自动完成
set history=1000 "记录历史的行数
s...
分类:
系统相关 时间:
2015-05-18 16:23:20
阅读次数:
228