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