From 4f6b1ce5201b72325af20717cce21f9e6adaae4a Mon Sep 17 00:00:00 2001 From: "vynhfx01574@funix.edu.vn" Date: Mon, 18 Nov 2024 16:14:22 +0700 Subject: [PATCH 1/3] First commit --- leetcode/string/pom.xml | 25 ++++++++++++++++++ .../string/{ => src/main/java}/AddBinary.java | 0 .../{ => src/main/java}/CountAndSay.java | 0 .../{ => src/main/java}/DecodeWays.java | 0 .../{ => src/main/java}/EditDistance.java | 0 .../java}/FirstUniqueCharacterInAString.java | 2 ++ .../main/java}/GenerateParentheses.java | 3 +++ .../main/java}/IntegerToEnglishWords.java | 0 .../{ => src/main/java}/JudgeRouteCircle.java | 0 .../main/java}/LongestCommonPrefix.java | 0 .../main/java}/LongestPalindrome.java | 2 ++ .../java}/LongestPalindromicSubstring.java | 0 ...ubstringWithAtMostKDistinctCharacters.java | 0 .../main/java}/MinimumWindowSubstring.java | 2 ++ .../{ => src/main/java}/MultiplyStrings.java | 0 .../{ => src/main/java}/OneEditDistance.java | 0 .../main/java}/PalindromePermutation.java | 0 .../main/java}/PalindromicSubstrings.java | 0 .../main/java}/ReverseVowelsOfAString.java | 0 .../main/java}/ReverseWordsInAString.java | 0 .../{ => src/main/java}/RomanToInteger.java | 2 ++ .../{ => src/main/java}/ValidPalindrome.java | 0 .../{ => src/main/java}/ValidParentheses.java | 2 ++ leetcode/string/src/test/java/FirstTest.java | 9 +++++++ .../string/target/classes/AddBinary.class | Bin 0 -> 1031 bytes .../string/target/classes/CountAndSay.class | Bin 0 -> 1133 bytes .../string/target/classes/DecodeWays.class | Bin 0 -> 894 bytes .../string/target/classes/EditDistance.class | Bin 0 -> 1071 bytes .../FirstUniqueCharacterInAString.class | Bin 0 -> 1613 bytes .../target/classes/GenerateParentheses.class | Bin 0 -> 1669 bytes .../classes/IntegerToEnglishWords.class | Bin 0 -> 2218 bytes .../target/classes/JudgeRouteCircle.class | Bin 0 -> 716 bytes .../target/classes/LongestCommonPrefix.class | Bin 0 -> 832 bytes .../target/classes/LongestPalindrome.class | Bin 0 -> 1210 bytes .../classes/LongestPalindromicSubstring.class | Bin 0 -> 1030 bytes ...bstringWithAtMostKDistinctCharacters.class | Bin 0 -> 968 bytes .../classes/MinimumWindowSubstring.class | Bin 0 -> 1882 bytes .../target/classes/MultiplyStrings.class | Bin 0 -> 1238 bytes .../target/classes/OneEditDistance.class | Bin 0 -> 883 bytes .../classes/PalindromePermutation.class | Bin 0 -> 739 bytes .../classes/PalindromicSubstrings.class | Bin 0 -> 882 bytes .../classes/ReverseVowelsOfAString.class | Bin 0 -> 1390 bytes .../classes/ReverseWordsInAString.class | Bin 0 -> 1246 bytes .../target/classes/RomanToInteger.class | Bin 0 -> 1312 bytes .../target/classes/ValidPalindrome.class | Bin 0 -> 771 bytes .../target/classes/ValidParentheses.class | Bin 0 -> 1185 bytes .../target/test-classes/FirstTest.class | Bin 0 -> 485 bytes 47 files changed, 47 insertions(+) create mode 100644 leetcode/string/pom.xml rename leetcode/string/{ => src/main/java}/AddBinary.java (100%) rename leetcode/string/{ => src/main/java}/CountAndSay.java (100%) rename leetcode/string/{ => src/main/java}/DecodeWays.java (100%) rename leetcode/string/{ => src/main/java}/EditDistance.java (100%) rename leetcode/string/{ => src/main/java}/FirstUniqueCharacterInAString.java (97%) rename leetcode/string/{ => src/main/java}/GenerateParentheses.java (94%) rename leetcode/string/{ => src/main/java}/IntegerToEnglishWords.java (100%) rename leetcode/string/{ => src/main/java}/JudgeRouteCircle.java (100%) rename leetcode/string/{ => src/main/java}/LongestCommonPrefix.java (100%) rename leetcode/string/{ => src/main/java}/LongestPalindrome.java (95%) rename leetcode/string/{ => src/main/java}/LongestPalindromicSubstring.java (100%) rename leetcode/string/{ => src/main/java}/LongestSubstringWithAtMostKDistinctCharacters.java (100%) rename leetcode/string/{ => src/main/java}/MinimumWindowSubstring.java (98%) rename leetcode/string/{ => src/main/java}/MultiplyStrings.java (100%) rename leetcode/string/{ => src/main/java}/OneEditDistance.java (100%) rename leetcode/string/{ => src/main/java}/PalindromePermutation.java (100%) rename leetcode/string/{ => src/main/java}/PalindromicSubstrings.java (100%) rename leetcode/string/{ => src/main/java}/ReverseVowelsOfAString.java (100%) rename leetcode/string/{ => src/main/java}/ReverseWordsInAString.java (100%) rename leetcode/string/{ => src/main/java}/RomanToInteger.java (96%) rename leetcode/string/{ => src/main/java}/ValidPalindrome.java (100%) rename leetcode/string/{ => src/main/java}/ValidParentheses.java (97%) create mode 100644 leetcode/string/src/test/java/FirstTest.java create mode 100644 leetcode/string/target/classes/AddBinary.class create mode 100644 leetcode/string/target/classes/CountAndSay.class create mode 100644 leetcode/string/target/classes/DecodeWays.class create mode 100644 leetcode/string/target/classes/EditDistance.class create mode 100644 leetcode/string/target/classes/FirstUniqueCharacterInAString.class create mode 100644 leetcode/string/target/classes/GenerateParentheses.class create mode 100644 leetcode/string/target/classes/IntegerToEnglishWords.class create mode 100644 leetcode/string/target/classes/JudgeRouteCircle.class create mode 100644 leetcode/string/target/classes/LongestCommonPrefix.class create mode 100644 leetcode/string/target/classes/LongestPalindrome.class create mode 100644 leetcode/string/target/classes/LongestPalindromicSubstring.class create mode 100644 leetcode/string/target/classes/LongestSubstringWithAtMostKDistinctCharacters.class create mode 100644 leetcode/string/target/classes/MinimumWindowSubstring.class create mode 100644 leetcode/string/target/classes/MultiplyStrings.class create mode 100644 leetcode/string/target/classes/OneEditDistance.class create mode 100644 leetcode/string/target/classes/PalindromePermutation.class create mode 100644 leetcode/string/target/classes/PalindromicSubstrings.class create mode 100644 leetcode/string/target/classes/ReverseVowelsOfAString.class create mode 100644 leetcode/string/target/classes/ReverseWordsInAString.class create mode 100644 leetcode/string/target/classes/RomanToInteger.class create mode 100644 leetcode/string/target/classes/ValidPalindrome.class create mode 100644 leetcode/string/target/classes/ValidParentheses.class create mode 100644 leetcode/string/target/test-classes/FirstTest.class diff --git a/leetcode/string/pom.xml b/leetcode/string/pom.xml new file mode 100644 index 00000000..ffa22a88 --- /dev/null +++ b/leetcode/string/pom.xml @@ -0,0 +1,25 @@ + + + 4.0.0 + + string + string + 1.0-SNAPSHOT + + + 17 + 17 + UTF-8 + + + + org.junit.jupiter + junit-jupiter + RELEASE + test + + + + \ No newline at end of file diff --git a/leetcode/string/AddBinary.java b/leetcode/string/src/main/java/AddBinary.java similarity index 100% rename from leetcode/string/AddBinary.java rename to leetcode/string/src/main/java/AddBinary.java diff --git a/leetcode/string/CountAndSay.java b/leetcode/string/src/main/java/CountAndSay.java similarity index 100% rename from leetcode/string/CountAndSay.java rename to leetcode/string/src/main/java/CountAndSay.java diff --git a/leetcode/string/DecodeWays.java b/leetcode/string/src/main/java/DecodeWays.java similarity index 100% rename from leetcode/string/DecodeWays.java rename to leetcode/string/src/main/java/DecodeWays.java diff --git a/leetcode/string/EditDistance.java b/leetcode/string/src/main/java/EditDistance.java similarity index 100% rename from leetcode/string/EditDistance.java rename to leetcode/string/src/main/java/EditDistance.java diff --git a/leetcode/string/FirstUniqueCharacterInAString.java b/leetcode/string/src/main/java/FirstUniqueCharacterInAString.java similarity index 97% rename from leetcode/string/FirstUniqueCharacterInAString.java rename to leetcode/string/src/main/java/FirstUniqueCharacterInAString.java index 00027a1d..962eaeb0 100644 --- a/leetcode/string/FirstUniqueCharacterInAString.java +++ b/leetcode/string/src/main/java/FirstUniqueCharacterInAString.java @@ -9,6 +9,8 @@ //return 2. //Note: You may assume the string contain only lowercase letters. +import java.util.HashMap; + class FirstUniqueCharacterInAString { public int firstUniqChar(String s) { HashMap characters = new HashMap(); diff --git a/leetcode/string/GenerateParentheses.java b/leetcode/string/src/main/java/GenerateParentheses.java similarity index 94% rename from leetcode/string/GenerateParentheses.java rename to leetcode/string/src/main/java/GenerateParentheses.java index 1a2e482d..d54a1f71 100644 --- a/leetcode/string/GenerateParentheses.java +++ b/leetcode/string/src/main/java/GenerateParentheses.java @@ -10,6 +10,9 @@ //"()()()" //] +import java.util.ArrayList; +import java.util.List; + class GenerateParentheses { public List generateParenthesis(int n) { List result = new ArrayList(); diff --git a/leetcode/string/IntegerToEnglishWords.java b/leetcode/string/src/main/java/IntegerToEnglishWords.java similarity index 100% rename from leetcode/string/IntegerToEnglishWords.java rename to leetcode/string/src/main/java/IntegerToEnglishWords.java diff --git a/leetcode/string/JudgeRouteCircle.java b/leetcode/string/src/main/java/JudgeRouteCircle.java similarity index 100% rename from leetcode/string/JudgeRouteCircle.java rename to leetcode/string/src/main/java/JudgeRouteCircle.java diff --git a/leetcode/string/LongestCommonPrefix.java b/leetcode/string/src/main/java/LongestCommonPrefix.java similarity index 100% rename from leetcode/string/LongestCommonPrefix.java rename to leetcode/string/src/main/java/LongestCommonPrefix.java diff --git a/leetcode/string/LongestPalindrome.java b/leetcode/string/src/main/java/LongestPalindrome.java similarity index 95% rename from leetcode/string/LongestPalindrome.java rename to leetcode/string/src/main/java/LongestPalindrome.java index 9eeb53f7..67d5ed2a 100644 --- a/leetcode/string/LongestPalindrome.java +++ b/leetcode/string/src/main/java/LongestPalindrome.java @@ -1,3 +1,5 @@ +import java.util.HashMap; + public class LongestPalindrome { public int longestPalindrome(String s) { HashMap map = new HashMap(); diff --git a/leetcode/string/LongestPalindromicSubstring.java b/leetcode/string/src/main/java/LongestPalindromicSubstring.java similarity index 100% rename from leetcode/string/LongestPalindromicSubstring.java rename to leetcode/string/src/main/java/LongestPalindromicSubstring.java diff --git a/leetcode/string/LongestSubstringWithAtMostKDistinctCharacters.java b/leetcode/string/src/main/java/LongestSubstringWithAtMostKDistinctCharacters.java similarity index 100% rename from leetcode/string/LongestSubstringWithAtMostKDistinctCharacters.java rename to leetcode/string/src/main/java/LongestSubstringWithAtMostKDistinctCharacters.java diff --git a/leetcode/string/MinimumWindowSubstring.java b/leetcode/string/src/main/java/MinimumWindowSubstring.java similarity index 98% rename from leetcode/string/MinimumWindowSubstring.java rename to leetcode/string/src/main/java/MinimumWindowSubstring.java index 6f57ad5a..bf46d5e4 100644 --- a/leetcode/string/MinimumWindowSubstring.java +++ b/leetcode/string/src/main/java/MinimumWindowSubstring.java @@ -9,6 +9,8 @@ // If there is no such window in S that covers all characters in T, return the empty string "". // If there are multiple such windows, you are guaranteed that there will always be only one unique minimum window in S. +import java.util.HashMap; + public class MinimumWindowSubstring { public String minWindow(String s, String t) { HashMap map = new HashMap<>(); diff --git a/leetcode/string/MultiplyStrings.java b/leetcode/string/src/main/java/MultiplyStrings.java similarity index 100% rename from leetcode/string/MultiplyStrings.java rename to leetcode/string/src/main/java/MultiplyStrings.java diff --git a/leetcode/string/OneEditDistance.java b/leetcode/string/src/main/java/OneEditDistance.java similarity index 100% rename from leetcode/string/OneEditDistance.java rename to leetcode/string/src/main/java/OneEditDistance.java diff --git a/leetcode/string/PalindromePermutation.java b/leetcode/string/src/main/java/PalindromePermutation.java similarity index 100% rename from leetcode/string/PalindromePermutation.java rename to leetcode/string/src/main/java/PalindromePermutation.java diff --git a/leetcode/string/PalindromicSubstrings.java b/leetcode/string/src/main/java/PalindromicSubstrings.java similarity index 100% rename from leetcode/string/PalindromicSubstrings.java rename to leetcode/string/src/main/java/PalindromicSubstrings.java diff --git a/leetcode/string/ReverseVowelsOfAString.java b/leetcode/string/src/main/java/ReverseVowelsOfAString.java similarity index 100% rename from leetcode/string/ReverseVowelsOfAString.java rename to leetcode/string/src/main/java/ReverseVowelsOfAString.java diff --git a/leetcode/string/ReverseWordsInAString.java b/leetcode/string/src/main/java/ReverseWordsInAString.java similarity index 100% rename from leetcode/string/ReverseWordsInAString.java rename to leetcode/string/src/main/java/ReverseWordsInAString.java diff --git a/leetcode/string/RomanToInteger.java b/leetcode/string/src/main/java/RomanToInteger.java similarity index 96% rename from leetcode/string/RomanToInteger.java rename to leetcode/string/src/main/java/RomanToInteger.java index e03af634..cf85bf87 100644 --- a/leetcode/string/RomanToInteger.java +++ b/leetcode/string/src/main/java/RomanToInteger.java @@ -2,6 +2,8 @@ // Input is guaranteed to be within the range from 1 to 3999 +import java.util.HashMap; + public class RomanToInteger { public int romanToInt(String s) { HashMap map = new HashMap(); diff --git a/leetcode/string/ValidPalindrome.java b/leetcode/string/src/main/java/ValidPalindrome.java similarity index 100% rename from leetcode/string/ValidPalindrome.java rename to leetcode/string/src/main/java/ValidPalindrome.java diff --git a/leetcode/string/ValidParentheses.java b/leetcode/string/src/main/java/ValidParentheses.java similarity index 97% rename from leetcode/string/ValidParentheses.java rename to leetcode/string/src/main/java/ValidParentheses.java index ee5a7bab..351bef67 100644 --- a/leetcode/string/ValidParentheses.java +++ b/leetcode/string/src/main/java/ValidParentheses.java @@ -2,6 +2,8 @@ // The brackets must close in the correct order, "()" and "()[]{}" are all valid but "(]" and "([)]" are not. +import java.util.Stack; + public class ValidParentheses { public boolean isValid(String s) { if(s.length() % 2 == 1) { diff --git a/leetcode/string/src/test/java/FirstTest.java b/leetcode/string/src/test/java/FirstTest.java new file mode 100644 index 00000000..13d16a75 --- /dev/null +++ b/leetcode/string/src/test/java/FirstTest.java @@ -0,0 +1,9 @@ +import org.junit.jupiter.api.Test; + +public class FirstTest { + OneEditDistance oneEditDistance = new OneEditDistance(); + @Test + public void setup(){ + + } +} diff --git a/leetcode/string/target/classes/AddBinary.class b/leetcode/string/target/classes/AddBinary.class new file mode 100644 index 0000000000000000000000000000000000000000..402e278ab671f7f316ce24d3049fc1a26971d338 GIT binary patch literal 1031 zcmaJ<+fEZv6kVrtE7JiAbObEOMbQ>0#am-iF9Fnqq(UN!@x?IhOxnR=+DxY;hF5;V z;JdH-QW8!406)nXaZRZZt=jbLbI#gpuYH;G^~a|#0PdlnBL+!>Y(Rl3kleNQt-NRX z)%<38*Qta8>Rs1&!}|hKCcCX6E--pd+6n{LudcRS&vpVG8YCSF7#jKw3}Em#!BZ{; zJ;$$xwT|F=L?1FRj1f92H7i(QN;$KhU5nIA0~at#kJV^6zAZ38Pw5}&i&4b5fs05B zXo0iu1WiXEo%w&nq=8GA5{QTOUlpeQ5>nJKBha^E+pDf`1#ej8THU7pV9E8Jjn-b- z37%PHkH~PTUa`DwD{!NG7nH-A+Z0HY&J>E2v(Dx2WO^Da_9DH#P)2ID_5{Q_mldV| zb3mksGN%|g&6dacj`uLSUywwlVg*rm!sXf(=-&#h%IhaqquYnRRc{3q=dl}gI&jv^ zQj`-jnC5$melbuAD(x(9dG3O{GJg#5vE#l>8@YivuFx8%1kB+oZvxklp=GexghUQ- z@EO|6WAtrE1$m(jUA7C#;_0rM$~(kO^$3qlxuBWK5mKhMU@C{oNgK)Jvb{r;Zla5( zdZ?bGIa5;_ZKPgs_X_g+lVekU3q5Db5twUZtc{5eOfMlSc@;@oodp?ux&0X7Gfxwn z!w|B(Eg^*m7{x=3;W<68FaaBrsA38pr_-cL)b3L%WKrar=c{FN-NvKS0v0>NI6#i4 z7@1A#=2<}k4J}Qe*$%B&b0sl literal 0 HcmV?d00001 diff --git a/leetcode/string/target/classes/CountAndSay.class b/leetcode/string/target/classes/CountAndSay.class new file mode 100644 index 0000000000000000000000000000000000000000..0085feacf435f28d1e013cb4f8867d5ccde30c2c GIT binary patch literal 1133 zcmaJ9~$Lfq+v#BQ})iEmTgj1O|`U(eba&B_60@|AkPrSs9*wdOwyS+9h$-&Ok;({uVEHX7<+~}ykvBns$E~R1q)6@U} literal 0 HcmV?d00001 diff --git a/leetcode/string/target/classes/DecodeWays.class b/leetcode/string/target/classes/DecodeWays.class new file mode 100644 index 0000000000000000000000000000000000000000..9c69a20fac2a4c4ae41496e1e86a12366381cca7 GIT binary patch literal 894 zcmZWoO>YuW6g>~#bbwCftJ7AB-(OG!8l!G%jRrND1j_$<7v!Kiw`AQH;X-H#TAUYT}2lMoeoMGgv3l+1ndogTaQ^l5s%g6{M7X-ug?Y8X+ zMEa&Tu;~iuxr-I@hKj5}?1gRhTJ~G>WI!bq9tGl6$F&cJ$4%RNV>Y`)Qq`Vib`MR@ z3H&)I{f@&Vt-2_&N7o%5PXSKPsBpLpE}l~tRWRTRgj#)?cciV=ebajX+U!qzsK`@c zy*KnM`;`+2i7$GUf|+px+q|*h2|)yRMtg-`nY-Yw?EHZEJ`G=`4Z`62zecOg2)NE7 z;Q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-SSEm}^xVy>Fp zsYI4E)T)-Hn^Y;Inwdclp-iKPcp{!DaGe+=E}ApzWD#vzct1H}_un^68p*#aSe$QF zG5oL7kca7yOeqi88t61HE^n*aJ^H#`Riu2mYH9kI!FAjAUupL8LBbZCq1%Q3_)7N+ z7_ziW(m&(K?ss5so#V5#@?+55F+r=`G(ZlM^u{oSXyTa`)vwgiIVcRog!kyGW5Y9aHTS;v*j&f<%Qb|XfZ_s={jApb8rhW|s3ZOX0}RK7 z9^nHHFg(Kq-yLQ6f><3xgMooqz==EZ1-*5g^1Vdg3P^c@=n5!ZYrIt=yPiYz)gUOZ zDRTk5+ChY9?L-h^x&tHVL6q)~F2cKUimy{|Z|jb;juf>Onuw z;XFl?FoFxnlP(M7eUY#L*T>b4?=E46)C=MbF5?O{V-g0gIv%rR$+d2tU8A$>gltFK kPe>v}_JeMqC4`m`_=yk`aqv5)mf&j};T^m|ras*K4R7>+jQ{`u literal 0 HcmV?d00001 diff --git a/leetcode/string/target/classes/GenerateParentheses.class b/leetcode/string/target/classes/GenerateParentheses.class new file mode 100644 index 0000000000000000000000000000000000000000..721fedc375aef7af508d050f0b58fe68bc36aed0 GIT binary patch literal 1669 zcmaJ??Q+vb6g}&Y$T-SJO+z!a}xyX#o^5 zgINo6HsjibyCFSuP5&@vbGLg zzgKTIo0a_{&SSxXW8(rAPvK9Zh~HCwPxoW|&1qc1WeZC-u3%YU_H+@($Zl7_Nvn_O zP_O({qGGEyuHs#R#pm)+H3GjQ^K4n#8V;u1%3v#=(~$uqu#i1YOddYq`Gq ze)#-Ag^%QcM^C90bfmX0L)W~g&YbSMEa9{!NLr`T6Evl_+)V4oI~I#6Abeg;suQYc z=y99p&k8PZ;WUQh!5bXwXJWU;`E3)=xwhN$r5=Xlb7LIEf2^|D1g24p1}EK^DoMqH zfg<*N#|t9nooQ>?Ioy+jRHCi3jWe;zc;dL31d8oo7vU zaaMt?TWH52MWyNT!k literal 0 HcmV?d00001 diff --git a/leetcode/string/target/classes/IntegerToEnglishWords.class b/leetcode/string/target/classes/IntegerToEnglishWords.class new file mode 100644 index 0000000000000000000000000000000000000000..aaac2e8ce6a52f2cb86e390fe6a364066a836d63 GIT binary patch literal 2218 zcma)8ZF3V<6n<`!W;ba{)7wI6Q=v!;C0Z&46)A{NT3Sp~bi+$P#ci@QOSijmvu&ww zpyK-_>wy;QfA7|s!UMO> z%jS|b>A4j%xMT-4N{zsD1CHw4$kxdJV`)(^4GnK)a1C#hEEjTFpl76opM=1IB32RD z*P?vOkQgi#a$VqPi;%61TPBIaBDG1c%138`J5^j+Uf}we3l1%^;8jfLqUqa8ZyFOp z&E}YT3oTb|LZHKqa(K<%i&Ga6v;4QYGi%XC%B>6;Y6NCwY0j)SYo!g|m5McOD>nTt z3m#O9%&ULe^MXd;oAo&>sCm^!XA(ElSjW2>-cxgWUts9*&fD&)w`7e)s~@ewv{?x} ze_i04&Esr3MoDM5sgBhcDtO+~N_}E$2b(NU1eVt8Rtxvdw=nvuO>BNk%@mWS;}~{e z@rHiLmnFoY&~aNJCI)qU%s&7>X1+V<9>stP#V>TLAL&N6+!&~}q z)s}`Y1$OZ+a=%UO|GXBW_3X#wD zJb+e?%al=0$abULCOeFBQg#|;O?DY&U3MGgY*KC~YO(8_b29fGlG3;rKOs}a-1ivGb;bXze~Z3+DBQ<|{LeT)Fh070GEh`T=lGqN z`0=0LNAKg!drT1zDdbri=w#9?KStdo)5G#RsP$qe{|+LDBN)Ij><+2rqw-B^Bmx&6 z$))%%>y%=QK8$zZGk=4bGe~HEaVa%ud)j%*?{Kq~ADBsP#$4D+>Rv9}a~GYYeJD4+ z0TZC5dKdk)oXus^&Ul_!XJ;Fz@-TGFRzq_&GB48nsIgsa2iVIZLzITmfqm%1ezq|} zs`;>)9T9;?&CE5MQN-K$>!NFbT?ABOSivfv{YaF7gBdB@0?9F*Y_5e#Mg zj0{D+(`ehM((&EN(Li;hNut_14#tYec63Bj+1H`kn;iF5{95)6QT3xhjt^z5%{~J~ zGSnXociCu*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AnH15L=@DWx=k~VpO&~^?Z}+(E}Qd_{5wS%pR@BSvqTVC_qhI^&UL$Ob=|4Ey79~u zgCW-crZ_1?Viak*OX3#*X+((ZJ=&#dWwZvzj=;V&!&78M7?5zEtkz1vG#=27VFnM$ zQZWlbCMaO{2b8x*=vk4n(u^FF#~V;TVR>RaCO6Rk6+;bN{D_g0eJ60Gfg78L7&?hG zaC`GWVh1ui{PS(1f$HnqJwG5i{J%j@rbHPZ@U-q^cWfHCX6EH=!+8|lx<`wPr?Fair!nXMT#wvCyLN9 VA_^47ruu&)s4a^DKA}hexxXJ>6K?mJ=t^Y#*fl=|ib^_reB=g?8@4a*HJ?FkV-~WC70$>?8BG8}*Aq@;6 zATY9Ry|fBV%WV`MSGVn&ClI*nxQtY4 zg%B5javCu(iiAM8vs>->&{U>W%9f8a4nizNFpgvpDFc@a%it8H2Bd({*LHWRcKeA{ zZSo{hZq=;jhShe|-anMymeUb1%NLMZ5*Tfs;>>sp=TSS$RzPfXlsFs?CQFGl#{K|w4mJiTnO1=--xEW*PY@qz zXt>N-T>~*(;cN^53^B`{z*Wp~R?a^m84B3Ue?uhSL+}j(iP%9RwyGCRwSR}ADWBbu zNvU>w$R(v&U!?gSlexT^lsydhF!mZzf3w<^;=|#OuFm=E;sImpeLgvM95Bol9YGvp zY`k&4eG*xuaGy=}i1s?qHjwUfzD-^;xP@z&C&w|YV1bsBzUk{w)^%j4WE2k>Cqv~q z-lq_ZYJVYv2#G)ZA+o LNh?o(4U7K)f>X|S literal 0 HcmV?d00001 diff --git a/leetcode/string/target/classes/LongestSubstringWithAtMostKDistinctCharacters.class b/leetcode/string/target/classes/LongestSubstringWithAtMostKDistinctCharacters.class new file mode 100644 index 0000000000000000000000000000000000000000..1d8908acd612694b1234c2687844a0c70cd41f39 GIT binary patch literal 968 zcmb7CO-~b16g{u=@n9IB6bDcdtths9w26t`pe6`0X(-fKgA0sdIvv`9GGnGwL&BC{ zVdBP^xN+kKjWPZJ*Zvw8;+bh95fc+9nfulrT&T!TbYWi$c$D65e+GX4FdH9~YqFT4! zNvNKBQEMgI2s+XFn%9Xu--%YqU^|f;cF3|CG+cqvis!qV-GjOtKC$akE%>*D;$60o2;&oF~lwU uRPqMM@urczP1YzB}-9@5OSo#Gm_Qm}G literal 0 HcmV?d00001 diff --git a/leetcode/string/target/classes/MinimumWindowSubstring.class b/leetcode/string/target/classes/MinimumWindowSubstring.class new file mode 100644 index 0000000000000000000000000000000000000000..96c46bd81bedcb9d459c285afdf2035ffa8acb82 GIT binary patch literal 1882 zcmZuyOK%%h6#lL~58IhM>M&{2LYkJeb?Q7wXs1b&^kpbb>m<;Ggr*Y8#4*VfXB^q% zqOK4qDFBst{p?%EqlgluBJ7RpLifVgp+?rK)1SJ9bhhv1Q*m_uO;7^ZMrc z(Z(efANubWlCYJ5oxm?b^DWJrwy=c|ZCUN#{rs&r(=6dNRiP91q ztM;wv>8ayI123VSC9W1&@nEbfM7a&ayEWBV6(b4NVc;MRvDQ@9^=!w@Urw`Dvj$|> zoV4#Wa2Q7zdMVA&M{3#ajxDQ=8R)_>fso^RGqOMagvLVX7C`XBQmG^d(r4fmX{BY- z?vl4GRRacI#c`@qauy7#urVA&9V`PUF(?qu7Z&oBnXzlz+E$+Bu#Qvg=s2mdQdpUF z+{Nq%Q_r20M0Sz+G$tK4JyBR$Nav>Qg$y;(WHx1IX6&3J_Z6k$EjxM6Hdz~Pmo zZaK(~=~S|*>QF^fJ)Me5K&1Ff2n13Ca_Q%eaihDvdBDB|SL{_%vV2@kcV?vKJv&Dm zF-E(zyT~~($EmVXrknKpP41?$1u{_bZ+q=GS2yb)-5p`1DyOX%p_+u7>^;p~>KQim zK3_w>pE}-Vao1R8WGY+8rP3E1+4=poo7*d2CNg%2_kjEaz}ld39pvAYmI z`^O_(@DJ`GGD=3 zhZc?B@ezLyT1wCl9__Jo!uMJsQ)ODcxAAS=dhs_Y@GozWr|8E9FAWVRL?=!Pi`T>u zhQ$a*#2Ji=^PIk9!y4*|)`0U!@NS!?r!UdZ!fVt;809m(PAM#zQDKdgF5nHxBuW=4 z1^7R61!K5`AoKkbmyu+px9|w#lvL*a2PP8SI+l&1xwKEc5a)cc!fyx5*1@C0g!Jq%YH3;6+_;jrjvlXm|>4b)vC M5@XFULIAV>199W0!vFvP literal 0 HcmV?d00001 diff --git a/leetcode/string/target/classes/MultiplyStrings.class b/leetcode/string/target/classes/MultiplyStrings.class new file mode 100644 index 0000000000000000000000000000000000000000..6a35ed7c01fc1fddaa5b6539114eafa286cf3d3b GIT binary patch literal 1238 zcmZ`&U2hXd6g^|Fch=(#u}!96nn1%x>yXq5A6+0ONI--LN(d+jRKbJSA4)cL)|Rub z1h3?|?=9k?yhP#&cnFAA5l?-9f50!P5UP8|4nkn?dhgu1_nb5L&g{JY@8vdt8O$ie z5SOrABw!1qSN&i8$+{mdPcD{MYn4dAJ{yEVbWR|iAG@jGASt0-q~Lx6Uy52mxJ-Dx z7A{9CUHF`V?{YDSG!vB-zjdC1R(@{mqC{3;&&Snz^b75vUahqhGKd?KH0B!@d$5-R zezRE%s{+FmnEwj3=wP3Km@>p+7bDm&;6#lN)eYtQnMH~31O^w{^(bi8@AjbUtn*@{ zT4Q292y0i{Yvo$&hF`8TlAUi<{Q6D56`1)>(27<9k}~t3=@hyC+K#lq>3m<|#s0__ zYUF-Wg`Ld_#G1#9InLO6dyTPGz5(ARiw@gs%x3#VdpVMXp@bwi8!R|>+bFJ=1#*3y zo#S8&151%#`DMXxcDt4E1k_Ta-Kx|s1!hZzKI^(*jt8SSz|YJ4Vi4v7qaEdJlB3|5 zIQksoX*Ye4)}#T2L$q!WfWtV#nZWn>ftKXhAcb7U-i&WSo|~ZYtPyRM{#Mh85v%Ii z+J1nNw&+SNA7F7@+glh&PgN(h>^Uo*qiroqUa~t_B~NK5m(Z$E@=_d=cM3X{R`t@N z2^zP#xFI{6oo5?1?Vo=k^Ye4;p0;y|X_=GTo)f23Qag`uBqw#U;Hezf9Qp%}R=*>a zv$fiSzO|7Qo1M2GQrX-l95ea$3EPRoY{3;|Y0YIE;0@b_-AMBr&LGeD3}>?#!U8mI z@k&&&7a?;IG50Wx``C}i-0^1|Ur^0#<8RcM!7=j3cok=Hl+PHF)ELD$J=Im3pqC>4 zI)0=lsar;Yo{fiGYqE>uhVLAP@usM04(kn$(~Gg*e{h1hICWm(Bt47OzQ9lLn7fb5 zIEB;HJ44P@s1BEq5(gw4{)Ld3rrLWb@ebGCA<eIYL#-O^eeT2z>k#J|pW*tSU H#&Gt3i!tx8 literal 0 HcmV?d00001 diff --git a/leetcode/string/target/classes/OneEditDistance.class b/leetcode/string/target/classes/OneEditDistance.class new file mode 100644 index 0000000000000000000000000000000000000000..4f8d09c55faf75517e8fcc29c6934140e7dd12ec GIT binary patch literal 883 zcmZWnO>+`K5Ph?|u&~*L1cHfC;&;LV2EPtgp((9ss(Nl*aJ%i3Dk7Y^n2a&x_5s4{qYmPV>~dRK-Hm{h#}4}-{Bv5 z+2ekzyxZuwPRI~{BzzHWGN^g0ZXkiA4#UI@%>U@MuqXT$(LL91h3z5THZX^jj(HOc zNHffxRo~%5&c5&&VtL!Ph?~Hoi7YNq5vR?2Pw8?kZ(CauSvGMID-6k?-w2|svIJJo zN{$p%B>S?799F50`=QUhfFYZoAdWh#SbI|5RTI~6o#gTc@#KBBj++drUEh7)6yY-w zgxq&r!nV3ia;d8D-Ix9ShTD6^8y-c{)vm+6I`0X2j)Gd)7F2MdI#s7aF%e7!8P+ES zMx9JZjw03`0~54tT2wuKoNjGUCvtN4D6HWAKZi85p8x;= literal 0 HcmV?d00001 diff --git a/leetcode/string/target/classes/PalindromePermutation.class b/leetcode/string/target/classes/PalindromePermutation.class new file mode 100644 index 0000000000000000000000000000000000000000..c1d266ba9219124e9db6fb04072fdc2fba4203d1 GIT binary patch literal 739 zcmZva-)a*<6vn^F&Suk?*fe&nsfo3<#l(gNq$pU8lm#V_Y9ZPS^}@+!Nwy}tW!?A$ zeFE>iErK__@uq@EAHdh}O7IB^Rli9JQFNC%GjqP*oIgAJ_2=hf0QazxMgoQfnSqI< zKyFvPQMJAby0ypcUC)gLl6U>UkLvD9h1g4vQ;5`}++FtZT zwfpqso1v@vJ1X+^{>&-kp8r~4uKC|+8v?Vg3dZrh3Bv5<=A_$k`5TpI0>bBLa4=~8 zUqm3SJ5g@zMI;i>9f4HX={VsqV0YP8tlU>yYHw7Xg$44ha2UDX17Ei=KPlmlp4W6G zSi}skLq7=!eIc|LxT|p%oXs1bAU=-dSz0ZF!=}xQ0bIn~$ae_^di3ERkPHPhW(2;N zTSmRKdIakLc6GIMgzSrT`SR`4eM5Zs_1&l&x1=qr#|J1@ZMkmly+f8#Nxp|^9PUd( z-{c{K8PEmXWLmvWGC_{E$ax7Nhb&bWTPK^sJm1SaeH~Xv yD@mns)_`6WQDO^8IJklZevxIYkkls@N!l<^k+QHPPEa_76rym#^a9r?68;UAr;#lH literal 0 HcmV?d00001 diff --git a/leetcode/string/target/classes/PalindromicSubstrings.class b/leetcode/string/target/classes/PalindromicSubstrings.class new file mode 100644 index 0000000000000000000000000000000000000000..aa4be0b7b8bb97cf5f1d8c4cd02efe53ff641924 GIT binary patch literal 882 zcmZva&2G~`6ot>kPTe{V32BowB`JmQlh}kxT_Kesp-M=R!jF_H61zH%NnBh9IS%3h zvS$r!5F0k#AVHB>uw=mt@C3XBLX*n0@z-CUJ_Fc-sUrbJgK8j& zIf3k+{nTFf?V!JYzq{u;k-*$dFYuyU0!ppkS-?CNH0TCWFa+`sY~Krd;c(w`+T-ph z3ca8|VovCe#y*opQ^y%(G-M5&MeZMg_B5Koz8mzT!Bl|Z^H?&FM}e{Kv&ap4#~Q9c zvDW%a7#G-VHtQX!vTUG)71nbGc6giOYOPt{=CVEPF*Vcj0{7l{zw3rOcGssT*BUyu z-?2ka?q^Ol8hGrW*gBRy+1e)SIKy!eo$NM$3RJzx<~>nroz1uM`9J{xf85?VOHe@E6TbX))(m3A<{3AR1TD_vb5izWLo9& zAr|GL?$Vef#M`6q=6h%d%u=Rm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!*b)|&S_l+xOdj0HS77#3b!E&!m`SyFL`!Xcy@^#@5}qeL1Kh=_ zt|WuF8(1fd|KF8c(@GQ%Fvf3G{X#sH{7PBgWi7`$KLqs5{sjGK9^YfBj+Go|8ErY> zJ|i2wB zV|^6(&et@kP-7eh{E{Q+LyYAJ|0z7;J%j#c_+<`}#1Pvip{rnRBI;`j(@aJA&LGX1 z#aPeq(lE=OafB|BG%#l%On;b#hAf*yn8yO|{rsiUf7+DK@SJTC)?Z)^8yNiyElx7Z literal 0 HcmV?d00001 diff --git a/leetcode/string/target/classes/RomanToInteger.class b/leetcode/string/target/classes/RomanToInteger.class new file mode 100644 index 0000000000000000000000000000000000000000..75f804999e4997dae95d25b893cf2d518499201f GIT binary patch literal 1312 zcmZuxO-~b16g`hlnKBO2f<;geKM-4}R1py^)JTo7Nr5N?b;r<-?LcX3J8k09#Ff9m zH5)c;OiUq~7&mVG3$EPx19T%1J+Cdbg*NG%IrpA-KhAw`z8-w|1Yj0-HMGH@Leb$w zyMTM$C>g=Dkx2#@*VfIrEzmw=Wh^@^;PClZRJa5@6;jc*(!qyDAvJI0G^lWBI00Qn zr;d~866pCKDv~ntM%*^@0&2-f7tO`z0)4)SKh}a1(%?b2iXIu~)M2(tNzsgLCS{af zU$k*=&CZ=FdUc#eAFIt3S^TuGAw{*L&~Zy+tQtwf8Jtxypkol{nsiyR^HwHFUD9SI zX{Rc>L?!*ajtjU*N1W~6V{(O6Mr2LHIxb^`%%n;4NQ;_UR^Wk8hhL_5Ss8mp3a4UB z;N;`%rjc3B*5yzl*@P+36|*wtLUD7=%r6^jX>Z zZKfef{UkL`@o@ZMCg@zUjrazSWUX0kDO=3P%?Fm0qo=v!ae4YUvr*mw`D+6UL_602 zQIJo;r*m`{;$6jkm8*1vGacuuR|%wEBNDid39j5M-ZPMswm%=CKHEjde83&ugQo1k zU558bz`a7`s-vewZmkYu5>C`%M8ZTJ-Y4{kpLIMhvExS#JHn1B#jA{!(XS-75D$!b zl`@9NDdW;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yENe^KVIjjRX^k1p7rTWVl5p4{rYh_0I$n literal 0 HcmV?d00001 diff --git a/leetcode/string/target/test-classes/FirstTest.class b/leetcode/string/target/test-classes/FirstTest.class new file mode 100644 index 0000000000000000000000000000000000000000..ff1bf933dc3691eac64ea0a84f1319ed22774f72 GIT binary patch literal 485 zcmZ8d+e*Vg5IviuO`FEvyjFbiO)HoWPz$2=DOk`_@NwHNbxOM_$;SWkK?(|ffFC7J zVyPFFJ1$=qky77eJY=1Fq3)`^oCP4G6KbO(quXU_R;ac zMM&Qq$ zk!Hm~7{!xdn(|DH3ouxUEW3 Date: Mon, 18 Nov 2024 16:26:15 +0700 Subject: [PATCH 2/3] Second commit --- "\357\200\272q" | 536 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 536 insertions(+) create mode 100644 "\357\200\272q" diff --git "a/\357\200\272q" "b/\357\200\272q" new file mode 100644 index 00000000..966faed5 --- /dev/null +++ "b/\357\200\272q" @@ -0,0 +1,536 @@ +commit 4f6b1ce5201b72325af20717cce21f9e6adaae4a (HEAD -> master) +Author: vynhfx01574@funix.edu.vn +Date: Mon Nov 18 16:14:22 2024 +0700 + + First commit + +commit a70c2250ec5f2e43972a359e050182f970ea2ffd (origin/master, origin/HEAD) +Author: Kevin Naughton Jr +Date: Fri Jun 5 22:37:07 2020 -0400 + + add the daily byte to table of contents + +commit feccc86c0d20f9770fd7175b32eb85d2ef945a65 +Author: Kevin Naughton Jr +Date: Fri Jun 5 22:34:21 2020 -0400 + + add the daily byte and update youtube image + +commit d1a5d070d0d41073c56b78c7588b77a409bf072f +Author: Kevin Naughton Jr +Date: Thu Sep 26 20:24:52 2019 -0400 + + Add files via upload + +commit 28321b6398eb49af094fc963148c331e90fe22fa +Author: Kevin Naughton Jr +Date: Thu Sep 26 20:24:38 2019 -0400 + + Delete youtube.jpg + +commit b0e47ced84df94bdf2a23621046765da896a3ace +Author: Kevin Naughton Jr +Date: Thu Sep 26 20:21:40 2019 -0400 + + Update README.md + +commit 9c77bfb54e0fec1287ed9ee97f44e21b17e6f23a +Author: Kevin Naughton Jr +Date: Thu Sep 26 20:21:00 2019 -0400 + + Add files via upload + +commit 8e1157b1ffe713ed682a3fa9231de2bac1a459bd +Author: Kevin Naughton Jr +Date: Thu Sep 26 20:20:48 2019 -0400 + + Delete youtube.jpg + +commit ff850e6b021f56a888aa8da5caf9bdf7a4b23702 +Author: Kevin Naughton Jr +Date: Thu Sep 26 20:20:05 2019 -0400 + + Delete youtube.jpg + +commit 67d244f131431cc1e60d1b5649de37b844ea5337 +Author: Kevin Naughton Jr +Date: Thu Sep 26 20:19:37 2019 -0400 + + Add files via upload + +commit 8097e71d9710acad3f1ba7d7546a001362d10605 +Author: Kevin Naughton +Date: Thu Oct 11 10:17:55 2018 -0400 + + add picture of YouTube + +commit 98cd3411f7de937dec274dce6d2e306d970cdfb7 +Merge: ea41dee c6a692b +Author: Kevin Naughton Jr +Date: Sun Sep 2 00:26:40 2018 -0400 + + Merge branch 'master' of https://github.com/kdn251/interviews + +commit ea41dee8a9b58bcb98b1f769f2ee70d9d96a6198 +Author: Kevin Naughton Jr +Date: Sun Sep 2 00:26:15 2018 -0400 + + add banner + +commit c6a692b529a87579526bbba19a5efc26dfb5f3c0 +Merge: 2bce2b8 5cc1062 +Author: Kevin Naughton Jr +Date: Sun Sep 2 00:08:55 2018 -0400 + + Merge pull request #77 from GrammarAndShape/patch-1 + + updated linked list, stack, and queue + +commit 2bce2b8b136dd057c8fad0bffbc660b40cfa5845 +Merge: 9b1dae1 67c261a +Author: Kevin Naughton Jr +Date: Sun Sep 2 00:06:08 2018 -0400 + + Merge pull request #86 from kdn251/new-problems + + add EncodeAndDecodeTinyURL.java + +commit 9b1dae13cdc680dd59c21afdbd3d26524676407c +Author: Kevin Naughton Jr +Date: Sat Sep 1 19:05:57 2018 -0400 + + add YouTube channel for video solutions + +commit e8a47218c2c0be29f79cd8f630231d817cbed2fc +Merge: 6e5075d 5cfd2f0 +Author: Kevin Naughton Jr +Date: Sat Jun 9 13:53:27 2018 -0400 + + Merge pull request #84 from jeffbdye/master + + Minor grammatical fix in the hashing section + +commit 6e5075d7cd579b214977a59295f78824686147ab +Merge: 991dc58 75f7285 +Author: Kevin Naughton Jr +Date: Sat Jun 9 13:51:44 2018 -0400 + + Merge pull request #65 from Froren/master + + Adds interviewing.io and CodinGame + +commit 67c261a92088b32d557f69b451b67612f54de462 +Author: Kevin Naughton Jr +Date: Tue Jun 5 14:17:29 2018 -0400 + + added PowerOfTwo.java + +commit df4ee95c2f5a8f0013519196b71b92e9cf99fcbc +Author: Kevin Naughton Jr +Date: Tue Jun 5 10:05:58 2018 -0400 + + added SpiralMatrix.java + +commit e815a7c69c1d949a86b3ab3b84aae91b43b76263 +Author: Kevin Naughton Jr +Date: Mon Jun 4 11:31:48 2018 -0400 + + added DailyTemperatures.java + +commit 3d5dc118ec97fede16c14a80ff0ed9149745c7f3 +Author: Kevin Naughton Jr +Date: Sun Jun 3 22:04:36 2018 -0400 + + added alternative solution to GuessNumberHigherOrLower.java + +commit fbbb6dbed8a14feac280c18550c58623ab0481ba +Author: Kevin Naughton Jr +Date: Sun Jun 3 21:58:41 2018 -0400 + + added FindAllNumbersDisappearedInAnArray.java + +commit 2dd7ba0183b30eaffc3ce8720c4b293894a6a7e3 +Author: Kevin Naughton Jr +Date: Sun Jun 3 21:49:44 2018 -0400 + + added FirstUniqueCharacterInAString.java + +commit a904bdf37f85141bcbd17ad28ad6341e243aaf0e +Author: Kevin Naughton Jr +Date: Sun Jun 3 21:24:53 2018 -0400 + + added new MergeIntervals.java solution + +commit e81f4e50958d85854c0ccb53bde87d36b4c46235 +Author: Kevin Naughton Jr +Date: Sun Jun 3 18:57:32 2018 -0400 + + added modified solution for LongestConsecutiveSequence.java + +commit f9c25d68d29cd74aba6ff2170f661752c6a9637b +Author: Kevin Naughton Jr +Date: Fri Jun 1 17:32:34 2018 -0400 + + adding JudgeRouteCircle.java + +commit 668d511047629388132131502285bd4734d3e3cc +Author: Kevin Naughton Jr +Date: Fri Jun 1 17:18:14 2018 -0400 + + adding BullsAndCows.java + +commit 86a1de891fdb2e54b8ca5e0cb16bf77c84416d2e +Author: Kevin Naughton Jr +Date: Wed May 30 20:57:42 2018 -0400 + + alternative solution for IslandPerimeter + +commit 547272f4ec68ed129fa6c984de88c866c6640717 +Author: Kevin Naughton Jr +Date: Tue May 29 15:43:37 2018 -0400 + + add EncodeAndDecodeTinyURL.java + +commit 991dc5805e3e31f4684405222cef447f2c5b891d +Merge: 5c74ad6 76c33ea +Author: Kevin Naughton Jr +Date: Tue May 29 13:21:00 2018 -0400 + + Merge pull request #78 from kdn251/new-problems + + Adding problems + +commit 76c33eadbf150c59af5e5c18c4e91ef7c6893539 +Author: Kevin Naughton Jr +Date: Tue May 29 13:18:59 2018 -0400 + + added edited version of LetterCombinationsOfAPhoneNumber.java + +commit a58514b70aab814dbfb9adf1a73e0d20cd8880ab +Author: Kevin Naughton Jr +Date: Mon May 28 17:39:17 2018 -0400 + + added MinStack.java + +commit c41d2e8acadc1bf94f5f00f13f2ee10153684191 +Author: Kevin Naughton Jr +Date: Mon May 28 12:03:51 2018 -0400 + + add PlusOne.java + +commit 0adbc0dc12372c65b2a8d0ac508b671edb951369 +Author: Kevin Naughton Jr +Date: Sat May 26 20:02:40 2018 -0400 + + added GenerateParentheses.java + +commit 7920d949812a1f2f83cb5b91afb606ca15102039 +Author: Kevin Naughton Jr +Date: Fri Apr 13 15:44:24 2018 -0400 + + adding HouseRobberII + +commit 36d7015cbc9f69e9a102fe47840bd258c884b1ef +Author: Kevin Naughton Jr +Date: Tue Apr 10 13:39:35 2018 -0400 + + add LongestIncreasingSubsequence + +commit 6a4460aea4bdcea6c79080111884e4c91e49f213 +Author: Kevin Naughton Jr +Date: Mon Apr 9 22:37:44 2018 -0400 + + adding CoinChange + +commit 6830e7c26970799ee25bddde0ed6a5d1f34e55df +Author: Kevin Naughton Jr +Date: Mon Apr 9 11:01:59 2018 -0400 + + add MinimumPathSum + +commit daf5e85bfcd35f3e143a7a796ed9f48443506ea7 +Author: Kevin Naughton Jr +Date: Fri Apr 6 09:33:36 2018 -0400 + + add PalindromicSubstrings and PaintHouse + +commit 84a1d4c9039b6570d21dcc62085ccf0aef123b3a +Author: Kevin Naughton Jr +Date: Thu Apr 5 21:56:59 2018 -0400 + + add MinCostClimbingStairs + +commit 76a22ae0dc6f0929dddf057cb9fdfcfd5c5e132c +Author: Kevin Naughton Jr +Date: Thu Apr 5 16:44:06 2018 -0400 + + edit house robber, update README + +commit 4b06ffc401550c6f5f17c8886781e7a8776c1921 +Author: Kevin Naughton Jr +Date: Wed Apr 4 09:57:27 2018 -0400 + + add valid sudoku + +commit b08c50ae6aead2f63e1d97ce3b7958aefb065c3c +Author: Kevin Naughton Jr +Date: Mon Apr 2 23:41:10 2018 -0400 + + ExclusiveTimeOfFunctions.java + +commit d9068148f0521623159c15627f9e4b0bab93bab7 +Author: Kevin Naughton Jr +Date: Mon Apr 2 15:55:23 2018 -0400 + + add InsertDeleteGetRandomO1.java + +commit 322523709c9bbded5dca52b77c9b5b178e86bba1 +Author: Kevin Naughton Jr +Date: Sun Apr 1 21:43:03 2018 -0400 + + adding additional problems + +commit 8ab35ca61136124404e1923ae437efefe35d7ece +Author: Kevin Naughton Jr +Date: Fri Mar 30 16:54:52 2018 -0400 + + added brainteaser directory + +commit 3634a936e8740078905164b1c8cf2c74fba931fc +Author: Kevin Naughton Jr +Date: Fri Mar 30 16:29:44 2018 -0400 + + add more problem solutions + +commit f50ed6c74df8e2da98beb612186d25c3691c4657 +Author: Kevin Naughton Jr +Date: Thu Mar 29 23:26:07 2018 -0400 + + added yahoo and palantir directories + +commit aecbde906a75a7a5a0d8da59fc65a8adc1ec9ac9 +Author: Kevin Naughton Jr +Date: Thu Mar 29 23:21:13 2018 -0400 + + added directories for snapchat, yelp, and apple + +commit 7c2237bd543b77e752c7cc3bf9ef7159271ed3fd +Author: Kevin Naughton Jr +Date: Thu Mar 29 11:47:57 2018 -0400 + + add adobe directory + +commit 6fbf1f41440e5d3a6048f767bf103450807c2673 +Author: Kevin Naughton Jr +Date: Thu Mar 29 11:23:44 2018 -0400 + + adding new problems + +commit 5cfd2f0b7978d4368774a615e3cfd2d9694d6e34 +Author: Jeff Dye +Date: Fri May 11 19:04:40 2018 -0400 + + Minor grammatical fix in the hashing section + +commit 5c74ad6bd593ae1c793115afa463e60089bd1e99 +Merge: cf4f5e2 90c2bf0 +Author: Kevin Naughton Jr +Date: Wed Apr 18 11:50:53 2018 -0400 + + Merge pull request #82 from brandonmanke/patch-1 + + Added working link for UC Berkeley video lectures + +commit 90c2bf0f3df4e113365857bcaf4aa77f9e00b2b4 +Author: Brandon Manke +Date: Mon Apr 16 21:40:18 2018 -0500 + + Added working link for UC Berkeley video lectures + + Added link to UC Berkeley webcasts on Archive.org. Due to the original YouTube playlist being removed [1]. + + [1] http://news.berkeley.edu/2017/03/01/course-capture/ + +commit cf4f5e2fb7cc40adb520d341a68d8996740ad304 +Merge: 8d8e067 ff791c3 +Author: Kevin Naughton Jr +Date: Mon Apr 9 22:17:33 2018 -0400 + + Merge pull request #81 from kdn251/add-license-1 + + Create LICENSE + +commit ff791c3e3f7abc804469b0c7a9a52dce9f62be86 +Author: Kevin Naughton Jr +Date: Mon Apr 9 22:17:24 2018 -0400 + + Create LICENSE + +commit 8d8e067f425b920d7c0b21d268e5a59aa557bd28 +Merge: b3a0200 1c47af5 +Author: Kevin Naughton Jr +Date: Mon Apr 9 22:13:40 2018 -0400 + + Merge pull request #79 from xitu/zh-hans + + fix format error + +commit 1c47af579bee889551c519f646b79cf80cb9d5e5 +Merge: 156652d 47698ea +Author: LeviDing +Date: Mon Apr 9 10:09:01 2018 +0800 + + Merge pull request #5 from xitu/master + + Update README-zh-cn.md + +commit 47698ea25b629a2a42c5b72a0d0a1b0bdee94008 +Author: LeviDing +Date: Mon Apr 9 10:07:36 2018 +0800 + + Update README-zh-cn.md + +commit 156652df368850dd135750242ec05419606ccd6a +Author: LeviDing +Date: Mon Apr 9 10:07:15 2018 +0800 + + Update README-zh-cn.md + +commit b3a02001ce4223e85d32cd9d47c23adcdd97e2fa +Merge: 8991f3d 33c3215 +Author: Kevin Naughton Jr +Date: Thu Apr 5 16:44:39 2018 -0400 + + Merge pull request #74 from kdn251/new-problems + + adding new problems + +commit 33c321593748ec961abf7c965159a2107d40da46 +Author: Kevin Naughton Jr +Date: Thu Apr 5 16:44:06 2018 -0400 + + edit house robber, update README + +commit f1fdb5840b1915345babbb0ddf4d235a3b2f6686 +Author: Kevin Naughton Jr +Date: Wed Apr 4 09:57:27 2018 -0400 + + add valid sudoku + +commit c2b18ee20445c88de8344e659de38df5662fbbe6 +Author: Kevin Naughton Jr +Date: Mon Apr 2 23:41:10 2018 -0400 + + ExclusiveTimeOfFunctions.java + +commit 61287cdedca91b30c813e3eeabf861f8dd76c5d0 +Author: Kevin Naughton Jr +Date: Mon Apr 2 15:55:23 2018 -0400 + + add InsertDeleteGetRandomO1.java + +commit 5cc106211180a54c87e7587b1b278236b9edb161 +Author: GrammarAndShape <37989185+GrammarAndShape@users.noreply.github.com> +Date: Sun Apr 1 19:37:13 2018 -0700 + + updated linked list, stack, and queue + + Fixed the grammar in "Doubly-linked list", and gave definitions for LIFO and FIFO + +commit f847f89c04f942ed6f26697d707402f87a7d705f +Author: Kevin Naughton Jr +Date: Sun Apr 1 21:43:03 2018 -0400 + + adding additional problems + +commit 75f72858012967ebc456447a211c7805984cdc64 +Author: Froren +Date: Fri Mar 30 19:51:09 2018 -0700 + + Remove codingame + +commit 380029c38a38ccec956c48b6d278692788878cc9 +Author: Kevin Naughton Jr +Date: Fri Mar 30 16:54:52 2018 -0400 + + added brainteaser directory + +commit 10347c64442c5fb2ceee0e06425c9722e43ecfed +Author: Kevin Naughton Jr +Date: Fri Mar 30 16:29:44 2018 -0400 + + add more problem solutions + +commit 4e65c9aabbdd6276ec76b132b237d0d09900f099 +Author: Kevin Naughton Jr +Date: Thu Mar 29 23:26:07 2018 -0400 + + added yahoo and palantir directories + +commit c9a3f2ac27df0981376d5592e6c02aa171e82135 +Author: Kevin Naughton Jr +Date: Thu Mar 29 23:21:13 2018 -0400 + + added directories for snapchat, yelp, and apple + +commit 05e15bb89185a865d3cdd4cdbabfc816043097f4 +Author: Kevin Naughton Jr +Date: Thu Mar 29 11:47:57 2018 -0400 + + add adobe directory + +commit 8991f3d1fbac30e9d4a415e966b99e9216729de8 +Merge: f0050c9 771ebf2 +Author: Kevin Naughton Jr +Date: Thu Mar 29 11:30:51 2018 -0400 + + Merge pull request #53 from xdream86/patch-1 + + Update README-zh-cn.md + +commit f0050c90e5a9df167dcd0fcc422576ff5af73e6c +Merge: e9d9860 aa46347 +Author: Kevin Naughton Jr +Date: Thu Mar 29 11:30:07 2018 -0400 + + Merge pull request #64 from iamquang95/fix-missing-space + + Fix missing space for nested
  • + +commit e9d98605c7d1517648a6a0978d4d64574b76773a +Merge: f97d580 04c6e48 +Author: Kevin Naughton Jr +Date: Thu Mar 29 11:29:26 2018 -0400 + + Merge pull request #72 from liuhea/patch-1 + + Update README-zh-cn.md + +commit f97d580ad9a1d69d6d68c452f66e619a27d7f045 +Merge: 6269878 e429abb +Author: Kevin Naughton Jr +Date: Thu Mar 29 11:28:07 2018 -0400 + + Merge pull request #71 from pedroAlba/patch-2 + + Fix README.md images + +commit 504af1b94fc6b5ce3952cf70da497434bc74a7f5 +Author: Kevin Naughton Jr +Date: Thu Mar 29 11:23:44 2018 -0400 + + adding new problems + +commit 04c6e480a339ac86e9c5ff3e421b5a43a1f5dc32 +Author: LiuHe +Date: Thu Mar 29 14:33:57 2018 +0800 + + Update README-zh-cn.md + + fix folder name + +commit e429abb6ba678294f3872ca1f0ad19bde87c10ec +Author: Pedro H. P Alba +Date: Wed Mar 28 08:33:07 2018 -0300 + + fix readme images From 2b774d1638254a52374ab43f14ccbc5ee574f87d Mon Sep 17 00:00:00 2001 From: "vynhfx01574@funix.edu.vn" Date: Mon, 18 Nov 2024 21:15:45 +0700 Subject: [PATCH 3/3] Add test and refactor method isOneEditDistance in \leetcode\string\src\main\java --- leetcode/string/pom.xml | 7 +- .../string/src/main/java/OneEditDistance.java | 1 - .../main/java/OneEditDistanceRefactor.java | 26 +++++++ leetcode/string/src/test/java/FirstTest.java | 9 --- .../java/OneEditDistanceRefactorTest.java | 65 +++++++++++++++++ .../src/test/java/OneEditDistanceTest.java | 67 ++++++++++++++++++ .../target/classes/OneEditDistance.class | Bin 883 -> 883 bytes .../classes/OneEditDistanceRefactor.class | Bin 0 -> 921 bytes .../target/test-classes/FirstTest.class | Bin 485 -> 0 bytes .../OneEditDistanceRefactorTest.class | Bin 0 -> 1975 bytes .../test-classes/OneEditDistanceTest.class | Bin 0 -> 1928 bytes 11 files changed, 162 insertions(+), 13 deletions(-) create mode 100644 leetcode/string/src/main/java/OneEditDistanceRefactor.java delete mode 100644 leetcode/string/src/test/java/FirstTest.java create mode 100644 leetcode/string/src/test/java/OneEditDistanceRefactorTest.java create mode 100644 leetcode/string/src/test/java/OneEditDistanceTest.java create mode 100644 leetcode/string/target/classes/OneEditDistanceRefactor.class delete mode 100644 leetcode/string/target/test-classes/FirstTest.class create mode 100644 leetcode/string/target/test-classes/OneEditDistanceRefactorTest.class create mode 100644 leetcode/string/target/test-classes/OneEditDistanceTest.class diff --git a/leetcode/string/pom.xml b/leetcode/string/pom.xml index ffa22a88..0b2867cd 100644 --- a/leetcode/string/pom.xml +++ b/leetcode/string/pom.xml @@ -14,10 +14,11 @@ UTF-8 + - org.junit.jupiter - junit-jupiter - RELEASE + junit + junit + 4.12 test diff --git a/leetcode/string/src/main/java/OneEditDistance.java b/leetcode/string/src/main/java/OneEditDistance.java index 685f9e7d..6fbcd938 100644 --- a/leetcode/string/src/main/java/OneEditDistance.java +++ b/leetcode/string/src/main/java/OneEditDistance.java @@ -12,7 +12,6 @@ public boolean isOneEditDistance(String s, String t) { } else if(s.length() < t.length()) { //return true if the strings would be the same if you deleted a character from string t return s.substring(i).equals(t.substring(i + 1)); - } else { //return true if the strings would be the same if you deleted a character from string s return t.substring(i).equals(s.substring(i + 1)); diff --git a/leetcode/string/src/main/java/OneEditDistanceRefactor.java b/leetcode/string/src/main/java/OneEditDistanceRefactor.java new file mode 100644 index 00000000..decfd313 --- /dev/null +++ b/leetcode/string/src/main/java/OneEditDistanceRefactor.java @@ -0,0 +1,26 @@ +public class OneEditDistanceRefactor { + public static boolean isOneEditDistance(String s, String t) { + int m = s.length(); + int n = t.length(); + + // If the length difference is greater than 1, can not have one edit + if (Math.abs(m - n) > 1) { + return false; + } + + // Make sure string s is always shorter than or equal to string t + if (m > n) { + return isOneEditDistance(t, s); + } + + for (int i = 0; i < m; i++) { + if (s.charAt(i) != t.charAt(i)) { + if (m == n) { + return s.substring(i + 1).equals(t.substring(i + 1)); + } + return s.substring(i).equals(t.substring(i + 1)); + } + } + return (n - m) == 1; + } +} diff --git a/leetcode/string/src/test/java/FirstTest.java b/leetcode/string/src/test/java/FirstTest.java deleted file mode 100644 index 13d16a75..00000000 --- a/leetcode/string/src/test/java/FirstTest.java +++ /dev/null @@ -1,9 +0,0 @@ -import org.junit.jupiter.api.Test; - -public class FirstTest { - OneEditDistance oneEditDistance = new OneEditDistance(); - @Test - public void setup(){ - - } -} diff --git a/leetcode/string/src/test/java/OneEditDistanceRefactorTest.java b/leetcode/string/src/test/java/OneEditDistanceRefactorTest.java new file mode 100644 index 00000000..a526877a --- /dev/null +++ b/leetcode/string/src/test/java/OneEditDistanceRefactorTest.java @@ -0,0 +1,65 @@ +import org.junit.Test; + +import static org.junit.Assert.*; + +public class OneEditDistanceRefactorTest { + OneEditDistanceRefactor oneEditDistance = new OneEditDistanceRefactor(); + + + @Test + public void testIsOneEditDistance_whenInsertOneCharacterInFirstString() { + String str1 = "ABCD"; + String str2 = "ABBD"; + + assertTrue(oneEditDistance.isOneEditDistance(str1, str2)); + } + + @Test + public void testIsOneEditDistance_whenDeleteOneCharactersInFirstString() { + String str1 = "ABCD"; + String str2 = "ABD"; + + assertTrue(oneEditDistance.isOneEditDistance(str1, str2)); + } + + @Test + public void testIsOneEditDistance_whenAddOneCharactersInFirstString() { + String str1 = "ABDE"; + String str2 = "ABCDE"; + + assertTrue(oneEditDistance.isOneEditDistance(str1, str2)); + } + + @Test + public void testIsOneEditDistance_whenTwoStringAreEquals() { + String str1 = "ABCD"; + String str2 = "ABCD"; + + assertFalse(oneEditDistance.isOneEditDistance(str1, str2)); + } + + @Test + public void testIsOneEditDistance_whenInsertTwoCharactersInFirstString() { + String str1 = "ABCD"; + String str2 = "ABEF"; + + assertFalse(oneEditDistance.isOneEditDistance(str1, str2)); + } + + @Test + public void testIsOneEditDistance_whenDeleteTwoCharactersInFirstString() { + String str1 = "ABCD"; + String str2 = "AB"; + + assertFalse(oneEditDistance.isOneEditDistance(str1, str2)); + } + + @Test + public void testIsOneEditDistance_whenAddTwoCharactersInFirstString() { + String str1 = "ABCD"; + String str2 = "ABCDEF"; + + assertFalse(oneEditDistance.isOneEditDistance(str1, str2)); + } + +} \ No newline at end of file diff --git a/leetcode/string/src/test/java/OneEditDistanceTest.java b/leetcode/string/src/test/java/OneEditDistanceTest.java new file mode 100644 index 00000000..859f23a8 --- /dev/null +++ b/leetcode/string/src/test/java/OneEditDistanceTest.java @@ -0,0 +1,67 @@ +import org.junit.Test; + +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + +public class OneEditDistanceTest { + OneEditDistance oneEditDistance = new OneEditDistance(); + + + @Test + public void testIsOneEditDistance_whenInsertOneCharacterInFirstString() { + String str1 = "ABCD"; + String str2 = "ABBD"; + + assertTrue(oneEditDistance.isOneEditDistance(str1, str2)); + } + + @Test + public void testIsOneEditDistance_whenDeleteOneCharactersInFirstString() { + String str1 = "ABCD"; + String str2 = "ABD"; + + assertTrue(oneEditDistance.isOneEditDistance(str1, str2)); + } + + @Test + public void testIsOneEditDistance_whenAddOneCharactersInFirstString() { + String str1 = "ABDE"; + String str2 = "ABCDE"; + + assertTrue(oneEditDistance.isOneEditDistance(str1, str2)); + } + + @Test + public void testIsOneEditDistance_whenTwoStringAreEquals() { + String str1 = "ABCD"; + String str2 = "ABCD"; + + assertFalse(oneEditDistance.isOneEditDistance(str1, str2)); + } + + @Test + public void testIsOneEditDistance_whenInsertTwoCharactersInFirstString() { + String str1 = "ABCD"; + String str2 = "ABEF"; + + assertFalse(oneEditDistance.isOneEditDistance(str1, str2)); + } + + @Test + public void testIsOneEditDistance_whenDeleteTwoCharactersInFirstString() { + String str1 = "ABCD"; + String str2 = "AB"; + + assertFalse(oneEditDistance.isOneEditDistance(str1, str2)); + } + + @Test + public void testIsOneEditDistance_whenAddTwoCharactersInFirstString() { + String str1 = "ABCD"; + String str2 = "ABCDEF"; + + assertFalse(oneEditDistance.isOneEditDistance(str1, str2)); + } + + +} diff --git a/leetcode/string/target/classes/OneEditDistance.class b/leetcode/string/target/classes/OneEditDistance.class index 4f8d09c55faf75517e8fcc29c6934140e7dd12ec..fac3668dc3fe68c7884828340e858fbf71bb1be4 100644 GIT binary patch delta 21 ccmey&_L*&iG&83lLmC4cLk@%ZWEEzA06^sg(*OVf delta 21 ccmey&_L*&iG&83VLmC4cLk@$)WEEzA06_Ny)c^nh diff --git a/leetcode/string/target/classes/OneEditDistanceRefactor.class b/leetcode/string/target/classes/OneEditDistanceRefactor.class new file mode 100644 index 0000000000000000000000000000000000000000..009c20471bbd0073e8835914a88659925b947cdb GIT binary patch literal 921 zcmZ`%TTc@~7(LUSvUFW8Efz$!DvHvJfEPkyDvbsqAt{o8;ejWo+Z7heR<~RI1O5+* zA>pMjzEonOKfs@4yq#Gv2*ii^X6AfnzB%Wc`S$DcR{-;vwUB^eLfS~8M__PAy-_m_ z6>QC{)^P2Kt4BHsNC4rIEz+0^Q(G$NFslfHtycf!inxR12Z=J~r zOy;X6rH_=9&m)CRE&sBOF*p?JZmaMy4eIL`bmoeUtGFhRYPD;vV>?+U&sWmy>o#s+ zf_1#tZPlQS?7t$8x>qi2vi?G|?g}=?#mVR>bSnO-fV}ix8!RD&VMeM*4@N7 zpCrL=0!E?#2jfldW;hGZ$>Jx7k8%1IqfUcklF>dQAddofDgCBIcvuWUvJ~*P*o8S? zVyHN|`XTz{K9WYq$?YRmDjs5}W6a5{bUt9An3Y|Omg4vx(@t&=BgEwME^28JWQ;D6ku!}of8Mw%rh^h2< OB&|ofoA;PY;Qk-WrMQa# literal 0 HcmV?d00001 diff --git a/leetcode/string/target/test-classes/FirstTest.class b/leetcode/string/target/test-classes/FirstTest.class deleted file mode 100644 index ff1bf933dc3691eac64ea0a84f1319ed22774f72..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 485 zcmZ8d+e*Vg5IviuO`FEvyjFbiO)HoWPz$2=DOk`_@NwHNbxOM_$;SWkK?(|ffFC7J zVyPFFJ1$=qky77eJY=1Fq3)`^oCP4G6KbO(quXU_R;ac zMM&Qq$ zk!Hm~7{!xdn(|DH3ouxUEW3Sr}oQ}vV7 z{_&Zt*aF>~ny%T~0{&RM9E2h;ysyiARkL%NWvhBc9>|Ys#Wu_kg7EjC7vUi8g>fH! z0;6r_mZZhnea7ud0wcvXg0zBufj}m^n^Q2*Xk~K_@j)0v7#8T)tR|_zT&#GrphMf# z^po`6p7>D+BX|_VXc%J{X9|XSk~*t%*{O_WNs~@PYNJsy>yqr)QM{~Rf|+Epv@_MP zlglfZ7U*&;=ADX9!GDne z{8*YL^|;2KXwj&swX$kz&ii#|z&_P1f$?^sIVqAU2evd`A>E3lYoayH#3U15^a4NwF1n=i@mR`6jT$eqW>3dp`Z_8;nMZ(dg^MSA^cq zC$BJgg@-rwqO1hE^0QJmJq^&6Q+LwUUf1=bAIn%_eP_-KwtQISEXVg6p8_vib02$i z2S^#Da){jFj=1YBxRb@`6L0P)xnop5CU>GE?nVnPbB^5N&NSydP3{bpv*gZo#7(#6 z&Utg^$xTwZKyIod?q+Ll+?%^h?h2Kw0d@bg}K^bD5|Z zP5c0UDC22M1k31)y;yg9?>*1&Jg2?={pZIo0NdCLBY6*185KJViAt(aTLtPf@npMzDOVw*Kj1Ypo=tCrg{scZ9 zZr0RBRW&sG{(7>@I@3&nVQ*M=s#$?o7XJ^tv3$5Zllp;f_r<{W&s0OLS<*PrOPXO? zZb~#_TE?=Cy%V6jwjwb0wxwIzg{*3(Mo&3iZ(6FQHFa8wm2WbQ-BkARO$H#3U{LhC%{Ewu9J`I3@rFD@>@0