Compare commits
No commits in common. "f70a0e7c2c66ebbba0b8cafb72a49965d918cf63" and "486c2e2ebf71a1473811c216ee35aff6a97d043e" have entirely different histories.
f70a0e7c2c
...
486c2e2ebf
|
|
@ -5,8 +5,10 @@
|
|||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="45f625e1-36c7-4942-8f7c-ba3ebe9a7d53" name="变更" comment="">
|
||||
<change afterPath="$PROJECT_DIR$/src/solution/test.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/solution/test.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/solution/test.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/README.md" beforeDir="false" afterPath="$PROJECT_DIR$/README.md" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/Solution.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/solution/Solution.java" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
|
|
@ -32,22 +34,22 @@
|
|||
<option name="hideEmptyMiddlePackages" value="true" />
|
||||
<option name="showLibraryContents" value="true" />
|
||||
</component>
|
||||
<component name="PropertiesComponent">{
|
||||
"keyToString": {
|
||||
"RunOnceActivity.OpenProjectViewOnStart": "true",
|
||||
"RunOnceActivity.ShowReadmeOnStart": "true",
|
||||
"WebServerToolWindowFactoryState": "false",
|
||||
"node.js.detected.package.eslint": "true",
|
||||
"node.js.detected.package.tslint": "true",
|
||||
"node.js.selected.package.eslint": "(autodetect)",
|
||||
"node.js.selected.package.tslint": "(autodetect)",
|
||||
"nodejs_package_manager_path": "npm",
|
||||
"project.structure.last.edited": "模块",
|
||||
"project.structure.proportion": "0.0",
|
||||
"project.structure.side.proportion": "0.0",
|
||||
"vue.rearranger.settings.migration": "true"
|
||||
<component name="PropertiesComponent"><![CDATA[{
|
||||
"keyToString": {
|
||||
"RunOnceActivity.OpenProjectViewOnStart": "true",
|
||||
"RunOnceActivity.ShowReadmeOnStart": "true",
|
||||
"WebServerToolWindowFactoryState": "false",
|
||||
"node.js.detected.package.eslint": "true",
|
||||
"node.js.detected.package.tslint": "true",
|
||||
"node.js.selected.package.eslint": "(autodetect)",
|
||||
"node.js.selected.package.tslint": "(autodetect)",
|
||||
"nodejs_package_manager_path": "npm",
|
||||
"project.structure.last.edited": "模块",
|
||||
"project.structure.proportion": "0.0",
|
||||
"project.structure.side.proportion": "0.0",
|
||||
"vue.rearranger.settings.migration": "true"
|
||||
}
|
||||
}</component>
|
||||
}]]></component>
|
||||
<component name="RunManager">
|
||||
<configuration name="test" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
|
||||
<option name="MAIN_CLASS_NAME" value="solution.test" />
|
||||
|
|
@ -77,7 +79,6 @@
|
|||
<option name="presentableId" value="Default" />
|
||||
<updated>1693822719192</updated>
|
||||
<workItem from="1693822720224" duration="5742000" />
|
||||
<workItem from="1693895305007" duration="634000" />
|
||||
</task>
|
||||
<servers />
|
||||
</component>
|
||||
|
|
@ -89,13 +90,8 @@
|
|||
<breakpoints>
|
||||
<line-breakpoint enabled="true" type="java-line">
|
||||
<url>file://$PROJECT_DIR$/src/solution/test.java</url>
|
||||
<line>24</line>
|
||||
<option name="timeStamp" value="4" />
|
||||
</line-breakpoint>
|
||||
<line-breakpoint enabled="true" type="java-line">
|
||||
<url>file://$PROJECT_DIR$/src/solution/test.java</url>
|
||||
<line>17</line>
|
||||
<option name="timeStamp" value="5" />
|
||||
<line>36</line>
|
||||
<option name="timeStamp" value="3" />
|
||||
</line-breakpoint>
|
||||
</breakpoints>
|
||||
</breakpoint-manager>
|
||||
|
|
|
|||
|
|
@ -4,8 +4,9 @@ package solution;
|
|||
public class test {
|
||||
public static void main(String[] args) {
|
||||
String s = "abcabcbb";
|
||||
int length = lengthOfLongestSubstring(s);
|
||||
System.out.println(length);
|
||||
Character a = 'a';
|
||||
// int length = lengthOfLongestSubstring(s);
|
||||
// System.out.println(isInString(a,));
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -16,18 +17,15 @@ public class test {
|
|||
for (int i = 0; i < s.length(); i++) {
|
||||
char temp = s.charAt(i);
|
||||
if (i == 0){
|
||||
longestString.append(temp);
|
||||
continue;
|
||||
}
|
||||
Character prChar = s.charAt(i-1);
|
||||
if (prChar != temp){
|
||||
boolean in = isInString(temp,longestString);
|
||||
if (!in){
|
||||
longestString.append(temp);
|
||||
lastMaxString.append(temp);
|
||||
}
|
||||
|
||||
} else {
|
||||
lastMaxString = longestString;
|
||||
}
|
||||
}
|
||||
return longestString.length();
|
||||
|
|
|
|||
Loading…
Reference in New Issue