pull/6/head
yuanguangxin 5 years ago
parent b49321bf97
commit 5c7a63cc15

@ -1,13 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="af7ffdf2-4ddc-4ed6-8222-60ed5acbc2ed" name="Default Changelist" comment=""> <list default="true" id="af7ffdf2-4ddc-4ed6-8222-60ed5acbc2ed" name="Default Changelist" comment="add q5/q7/q172">
<change afterPath="$PROJECT_DIR$/src/q5/f1/Solution.java" afterDir="false" /> <change afterPath="$PROJECT_DIR$/src/q9/Solution.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/q5/f2/Solution.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/q7/f1/Solution.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/q7/f2/Solution.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Rocket.md" beforeDir="false" afterPath="$PROJECT_DIR$/Rocket.md" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/q172/f2/Solution.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/q172/f2/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" />
@ -75,12 +71,12 @@
</key> </key>
</component> </component>
<component name="RunManager" selected="Application.Solution (2)"> <component name="RunManager" selected="Application.Solution (2)">
<configuration name="Main (1)" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true"> <configuration name="Solution (2)" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="etc.ali.q4.Main" /> <option name="MAIN_CLASS_NAME" value="q7.f2.Solution" />
<module name="LeetCode" /> <module name="LeetCode" />
<extension name="coverage"> <extension name="coverage">
<pattern> <pattern>
<option name="PATTERN" value="etc.ali.q4.*" /> <option name="PATTERN" value="q7.f2.*" />
<option name="ENABLED" value="true" /> <option name="ENABLED" value="true" />
</pattern> </pattern>
</extension> </extension>
@ -88,12 +84,12 @@
<option name="Make" enabled="true" /> <option name="Make" enabled="true" />
</method> </method>
</configuration> </configuration>
<configuration name="Solution (1)" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true"> <configuration name="Solution (3)" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="q5.f1.Solution" /> <option name="MAIN_CLASS_NAME" value="q7.f1.Solution" />
<module name="LeetCode" /> <module name="LeetCode" />
<extension name="coverage"> <extension name="coverage">
<pattern> <pattern>
<option name="PATTERN" value="q5.f1.*" /> <option name="PATTERN" value="q7.f1.*" />
<option name="ENABLED" value="true" /> <option name="ENABLED" value="true" />
</pattern> </pattern>
</extension> </extension>
@ -101,12 +97,12 @@
<option name="Make" enabled="true" /> <option name="Make" enabled="true" />
</method> </method>
</configuration> </configuration>
<configuration name="Solution (2)" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true"> <configuration name="Solution (4)" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="q7.f2.Solution" /> <option name="MAIN_CLASS_NAME" value="q9.Solution" />
<module name="LeetCode" /> <module name="LeetCode" />
<extension name="coverage"> <extension name="coverage">
<pattern> <pattern>
<option name="PATTERN" value="q7.f2.*" /> <option name="PATTERN" value="q9.*" />
<option name="ENABLED" value="true" /> <option name="ENABLED" value="true" />
</pattern> </pattern>
</extension> </extension>
@ -169,10 +165,10 @@
<recent_temporary> <recent_temporary>
<list> <list>
<item itemvalue="Application.Solution (2)" /> <item itemvalue="Application.Solution (2)" />
<item itemvalue="Application.Solution (4)" />
<item itemvalue="Application.Solution (3)" />
<item itemvalue="Application.Solution (2)" /> <item itemvalue="Application.Solution (2)" />
<item itemvalue="Application.Solution" /> <item itemvalue="Application.Solution" />
<item itemvalue="Application.Solution (1)" />
<item itemvalue="Application.Threads" />
</list> </list>
</recent_temporary> </recent_temporary>
</component> </component>
@ -210,66 +206,82 @@
<workItem from="1579695121386" duration="2796000" /> <workItem from="1579695121386" duration="2796000" />
<workItem from="1579758668363" duration="319000" /> <workItem from="1579758668363" duration="319000" />
<workItem from="1579759214129" duration="10251000" /> <workItem from="1579759214129" duration="10251000" />
<workItem from="1580044287086" duration="865000" /> <workItem from="1580044287086" duration="7777000" />
</task>
<task id="LOCAL-00001" summary="add q5/q7/q172">
<created>1580045439607</created>
<option name="number" value="00001" />
<option name="presentableId" value="LOCAL-00001" />
<option name="project" value="LOCAL" />
<updated>1580045439608</updated>
</task> </task>
<option name="localTasksCounter" value="2" />
<servers /> <servers />
</component> </component>
<component name="TypeScriptGeneratedFilesManager"> <component name="TypeScriptGeneratedFilesManager">
<option name="version" value="1" /> <option name="version" value="1" />
</component> </component>
<component name="VcsManagerConfiguration">
<MESSAGE value="add q5/q7/q172" />
<option name="LAST_COMMIT_MESSAGE" value="add q5/q7/q172" />
</component>
<component name="WindowStateProjectService"> <component name="WindowStateProjectService">
<state x="533" y="166" key="#com.intellij.ide.util.MemberChooser" timestamp="1578548165321"> <state x="533" y="166" key="#com.intellij.ide.util.MemberChooser" timestamp="1578548165321">
<screen x="0" y="0" width="1440" height="900" /> <screen x="0" y="0" width="1440" height="900" />
</state> </state>
<state x="533" y="166" key="#com.intellij.ide.util.MemberChooser/0.0.1440.900@0.0.1440.900" timestamp="1578548165321" /> <state x="533" y="166" key="#com.intellij.ide.util.MemberChooser/0.0.1440.900@0.0.1440.900" timestamp="1578548165321" />
<state x="303" y="50" key="CommitChangelistDialog2" timestamp="1580045414311"> <state x="303" y="50" key="CommitChangelistDialog2" timestamp="1580045607834">
<screen x="0" y="0" width="1440" height="900" /> <screen x="0" y="0" width="1440" height="900" />
</state> </state>
<state x="303" y="50" key="CommitChangelistDialog2/0.0.1440.900@0.0.1440.900" timestamp="1580045414311" /> <state x="303" y="50" key="CommitChangelistDialog2/0.0.1440.900@0.0.1440.900" timestamp="1580045607834" />
<state width="1398" height="193" key="GridCell.Tab.0.bottom" timestamp="1580045093251"> <state width="1398" height="193" key="GridCell.Tab.0.bottom" timestamp="1580057111711">
<screen x="0" y="0" width="1440" height="900" /> <screen x="0" y="0" width="1440" height="900" />
</state> </state>
<state width="1398" height="193" key="GridCell.Tab.0.bottom/0.0.1440.900@0.0.1440.900" timestamp="1580045093251" /> <state width="1398" height="193" key="GridCell.Tab.0.bottom/0.0.1440.900@0.0.1440.900" timestamp="1580057111711" />
<state width="1398" height="193" key="GridCell.Tab.0.bottom/0.23.1440.797@0.23.1440.797" timestamp="1579796075437" /> <state width="1398" height="193" key="GridCell.Tab.0.bottom/0.23.1440.797@0.23.1440.797" timestamp="1579796075437" />
<state width="1398" height="193" key="GridCell.Tab.0.center" timestamp="1580045093248"> <state width="1398" height="193" key="GridCell.Tab.0.center" timestamp="1580057111710">
<screen x="0" y="0" width="1440" height="900" /> <screen x="0" y="0" width="1440" height="900" />
</state> </state>
<state width="1398" height="193" key="GridCell.Tab.0.center/0.0.1440.900@0.0.1440.900" timestamp="1580045093248" /> <state width="1398" height="193" key="GridCell.Tab.0.center/0.0.1440.900@0.0.1440.900" timestamp="1580057111710" />
<state width="1398" height="193" key="GridCell.Tab.0.center/0.23.1440.797@0.23.1440.797" timestamp="1579796075436" /> <state width="1398" height="193" key="GridCell.Tab.0.center/0.23.1440.797@0.23.1440.797" timestamp="1579796075436" />
<state width="1398" height="193" key="GridCell.Tab.0.left" timestamp="1580045093246"> <state width="1398" height="193" key="GridCell.Tab.0.left" timestamp="1580057111709">
<screen x="0" y="0" width="1440" height="900" /> <screen x="0" y="0" width="1440" height="900" />
</state> </state>
<state width="1398" height="193" key="GridCell.Tab.0.left/0.0.1440.900@0.0.1440.900" timestamp="1580045093246" /> <state width="1398" height="193" key="GridCell.Tab.0.left/0.0.1440.900@0.0.1440.900" timestamp="1580057111709" />
<state width="1398" height="193" key="GridCell.Tab.0.left/0.23.1440.797@0.23.1440.797" timestamp="1579796075435" /> <state width="1398" height="193" key="GridCell.Tab.0.left/0.23.1440.797@0.23.1440.797" timestamp="1579796075435" />
<state width="1398" height="193" key="GridCell.Tab.0.right" timestamp="1580045093249"> <state width="1398" height="193" key="GridCell.Tab.0.right" timestamp="1580057111710">
<screen x="0" y="0" width="1440" height="900" /> <screen x="0" y="0" width="1440" height="900" />
</state> </state>
<state width="1398" height="193" key="GridCell.Tab.0.right/0.0.1440.900@0.0.1440.900" timestamp="1580045093249" /> <state width="1398" height="193" key="GridCell.Tab.0.right/0.0.1440.900@0.0.1440.900" timestamp="1580057111710" />
<state width="1398" height="193" key="GridCell.Tab.0.right/0.23.1440.797@0.23.1440.797" timestamp="1579796075437" /> <state width="1398" height="193" key="GridCell.Tab.0.right/0.23.1440.797@0.23.1440.797" timestamp="1579796075437" />
<state width="1398" height="303" key="GridCell.Tab.1.bottom" timestamp="1580044282990"> <state width="1398" height="134" key="GridCell.Tab.1.bottom" timestamp="1580056329388">
<screen x="0" y="0" width="1440" height="900" /> <screen x="0" y="0" width="1440" height="900" />
</state> </state>
<state width="1398" height="303" key="GridCell.Tab.1.bottom/0.0.1440.900@0.0.1440.900" timestamp="1580044282990" /> <state width="1398" height="134" key="GridCell.Tab.1.bottom/0.0.1440.900@0.0.1440.900" timestamp="1580056329388" />
<state width="1398" height="303" key="GridCell.Tab.1.bottom/0.23.1440.797@0.23.1440.797" timestamp="1579765319366" /> <state width="1398" height="303" key="GridCell.Tab.1.bottom/0.23.1440.797@0.23.1440.797" timestamp="1579765319366" />
<state width="1398" height="303" key="GridCell.Tab.1.center" timestamp="1580044282989"> <state width="1398" height="134" key="GridCell.Tab.1.center" timestamp="1580056329386">
<screen x="0" y="0" width="1440" height="900" /> <screen x="0" y="0" width="1440" height="900" />
</state> </state>
<state width="1398" height="303" key="GridCell.Tab.1.center/0.0.1440.900@0.0.1440.900" timestamp="1580044282989" /> <state width="1398" height="134" key="GridCell.Tab.1.center/0.0.1440.900@0.0.1440.900" timestamp="1580056329386" />
<state width="1398" height="303" key="GridCell.Tab.1.center/0.23.1440.797@0.23.1440.797" timestamp="1579765319364" /> <state width="1398" height="303" key="GridCell.Tab.1.center/0.23.1440.797@0.23.1440.797" timestamp="1579765319364" />
<state width="1398" height="303" key="GridCell.Tab.1.left" timestamp="1580044282988"> <state width="1398" height="134" key="GridCell.Tab.1.left" timestamp="1580056329385">
<screen x="0" y="0" width="1440" height="900" /> <screen x="0" y="0" width="1440" height="900" />
</state> </state>
<state width="1398" height="303" key="GridCell.Tab.1.left/0.0.1440.900@0.0.1440.900" timestamp="1580044282988" /> <state width="1398" height="134" key="GridCell.Tab.1.left/0.0.1440.900@0.0.1440.900" timestamp="1580056329385" />
<state width="1398" height="303" key="GridCell.Tab.1.left/0.23.1440.797@0.23.1440.797" timestamp="1579765319363" /> <state width="1398" height="303" key="GridCell.Tab.1.left/0.23.1440.797@0.23.1440.797" timestamp="1579765319363" />
<state width="1398" height="303" key="GridCell.Tab.1.right" timestamp="1580044282989"> <state width="1398" height="134" key="GridCell.Tab.1.right" timestamp="1580056329387">
<screen x="0" y="0" width="1440" height="900" /> <screen x="0" y="0" width="1440" height="900" />
</state> </state>
<state width="1398" height="303" key="GridCell.Tab.1.right/0.0.1440.900@0.0.1440.900" timestamp="1580044282989" /> <state width="1398" height="134" key="GridCell.Tab.1.right/0.0.1440.900@0.0.1440.900" timestamp="1580056329387" />
<state width="1398" height="303" key="GridCell.Tab.1.right/0.23.1440.797@0.23.1440.797" timestamp="1579765319365" /> <state width="1398" height="303" key="GridCell.Tab.1.right/0.23.1440.797@0.23.1440.797" timestamp="1579765319365" />
<state x="221" y="88" key="SettingsEditor" timestamp="1578704600210"> <state x="221" y="88" key="SettingsEditor" timestamp="1578704600210">
<screen x="0" y="0" width="1440" height="900" /> <screen x="0" y="0" width="1440" height="900" />
</state> </state>
<state x="221" y="88" key="SettingsEditor/0.0.1440.900@0.0.1440.900" timestamp="1578704600210" /> <state x="221" y="88" key="SettingsEditor/0.0.1440.900@0.0.1440.900" timestamp="1578704600210" />
<state x="320" y="190" key="Vcs.Push.Dialog.v2" timestamp="1580045441684">
<screen x="0" y="0" width="1440" height="900" />
</state>
<state x="320" y="190" key="Vcs.Push.Dialog.v2/0.0.1440.900@0.0.1440.900" timestamp="1580045441684" />
<state x="378" y="207" width="683" height="486" key="find.popup" timestamp="1578496174047"> <state x="378" y="207" width="683" height="486" key="find.popup" timestamp="1578496174047">
<screen x="0" y="0" width="1440" height="900" /> <screen x="0" y="0" width="1440" height="900" />
</state> </state>

@ -0,0 +1,30 @@
package q9;
/**
* String o(log(n))
*/
public class Solution {
public boolean isPalindrome(int x) {
if (x < 0) {
return false;
}
if (x < 10) {
return true;
}
if (x % 10 == 0) {
return false;
}
int rs = 0;
while (rs < x / 10) {
int y = x % 10;
x = x / 10;
rs = rs * 10 + y;
if (rs == x) {
return true;
} else if (x / 10 == rs) {
return true;
}
}
return false;
}
}
Loading…
Cancel
Save