From d5ef136e1a27c0d7af8caf0fe16e118d47def43c Mon Sep 17 00:00:00 2001 From: hzq Date: Mon, 22 Nov 2021 13:12:40 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=86=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/offer0038/Solution.java | 4 +--- src/offer0038/test.java | 9 +++++---- src/s0221/Solution.java | 2 -- src/s0221/test.java | 6 ++++-- src/s0516/Solution.java | 2 -- src/s0516/test.java | 14 ++++++++------ 6 files changed, 18 insertions(+), 19 deletions(-) diff --git a/src/offer0038/Solution.java b/src/offer0038/Solution.java index 085e139..62d2999 100644 --- a/src/offer0038/Solution.java +++ b/src/offer0038/Solution.java @@ -1,8 +1,6 @@ -package offer0038; - /** * Description: these message can be deleted - * Author:sold out + * Author:何正清 * Create Date: 2021/11/16 21:35 * Version: JDK 1.8 */ diff --git a/src/offer0038/test.java b/src/offer0038/test.java index 1b5288e..b11f437 100644 --- a/src/offer0038/test.java +++ b/src/offer0038/test.java @@ -1,4 +1,4 @@ -package offer0038; +import org.junit.Test; /** * Description: these message can be deleted @@ -7,7 +7,9 @@ package offer0038; * Version: JDK 1.8 */ public class test { - public static void main(String[] args) { + + @Test + public void T() { Solution s = new Solution(); String[] res1 = { "abc", "acb", "bac", "bca", "cab", "cba" }; // 答案1 String[] res2 = { "ab", "ba" }; // 答案2 @@ -23,8 +25,7 @@ public class test { System.out.println(testTwoArray(resource4, res4)); } - - public static boolean testTwoArray(String[] source, String[] res) { + public boolean testTwoArray(String[] source, String[] res) { // 验证两个数组是否相同 // 不考虑顺序 String[] str1 = source; diff --git a/src/s0221/Solution.java b/src/s0221/Solution.java index b265fe1..665dc17 100644 --- a/src/s0221/Solution.java +++ b/src/s0221/Solution.java @@ -1,5 +1,3 @@ -package s0221; - /** * Description: these message can be deleted * Author:sold out diff --git a/src/s0221/test.java b/src/s0221/test.java index 1a27ea1..f33033f 100644 --- a/src/s0221/test.java +++ b/src/s0221/test.java @@ -1,4 +1,4 @@ -package s0221; +import org.junit.Test; /** * Description: these message can be deleted @@ -7,7 +7,9 @@ package s0221; * Version: JDK 1.8 */ public class test { - public static void main(String[] args) { + + @Test + public void T() { Solution s = new Solution(); // 实验数据 char[][] resource1 = { { '0', '1', '1' }, { '0', '1', '1' }, { '0', '1', '1' }, { '0', '1', '1' } }; diff --git a/src/s0516/Solution.java b/src/s0516/Solution.java index 32c369a..5ec94be 100644 --- a/src/s0516/Solution.java +++ b/src/s0516/Solution.java @@ -1,5 +1,3 @@ -package s0516; - /** * Description: these message can be deleted * Author:sold out diff --git a/src/s0516/test.java b/src/s0516/test.java index f6be1fd..e44ca53 100644 --- a/src/s0516/test.java +++ b/src/s0516/test.java @@ -1,4 +1,4 @@ -package s0516; +import org.junit.Test; /** * Description: these message can be deleted @@ -7,7 +7,9 @@ package s0516; * Version: JDK 1.8 */ public class test { - public static void main(String[] args) { + + @Test + public void T() { Solution s = new Solution(); // 测试数据 String resource1 = "bbbab"; @@ -16,9 +18,9 @@ public class test { String resource4 = "abbbcbc"; // 测试 System.out.println(s.longestPalindromeSubseq(resource1) == 4 ? true : false); - System.out.println(s.longestPalindromeSubseq(resource2) == 5 ? true : false); - System.out.println(s.longestPalindromeSubseq(resource3) == 3 ? true : false); - System.out.println(s.longestPalindromeSubseq(resource4) == 4 ? true : false); - + System.out.println(s.longestPalindromeSubseq(resource1) == 5 ? true : false); + System.out.println(s.longestPalindromeSubseq(resource1) == 3 ? true : false); + System.out.println(s.longestPalindromeSubseq(resource1) == 4 ? true : false); } + } -- Gitee From 35fb5949943738a49749803de7dea29e5974088d Mon Sep 17 00:00:00 2001 From: hzq Date: Mon, 22 Nov 2021 19:56:31 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=8A=A0=E5=85=A5=E5=8C=85=E5=90=8D,?= =?UTF-8?q?=E6=9B=B4=E6=AD=A3=E4=BA=86=E6=B5=8B=E8=AF=95=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/leetcode1.iml | 11 +++++++++++ src/offer0038/Solution.java | 3 +-- src/offer0038/test.java | 1 + src/s0221/Solution.java | 5 ++--- src/s0221/test.java | 5 ++--- src/s0516/Solution.java | 5 ++--- src/s0516/test.java | 5 ++--- 7 files changed, 21 insertions(+), 14 deletions(-) create mode 100644 src/leetcode1.iml diff --git a/src/leetcode1.iml b/src/leetcode1.iml new file mode 100644 index 0000000..b107a2d --- /dev/null +++ b/src/leetcode1.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/src/offer0038/Solution.java b/src/offer0038/Solution.java index 62d2999..312f242 100644 --- a/src/offer0038/Solution.java +++ b/src/offer0038/Solution.java @@ -1,8 +1,7 @@ +package offer0038; /** - * Description: these message can be deleted * Author:何正清 * Create Date: 2021/11/16 21:35 - * Version: JDK 1.8 */ public class Solution { diff --git a/src/offer0038/test.java b/src/offer0038/test.java index b11f437..38cc4f0 100644 --- a/src/offer0038/test.java +++ b/src/offer0038/test.java @@ -1,3 +1,4 @@ +package offer0038; import org.junit.Test; /** diff --git a/src/s0221/Solution.java b/src/s0221/Solution.java index 665dc17..83b0c63 100644 --- a/src/s0221/Solution.java +++ b/src/s0221/Solution.java @@ -1,8 +1,7 @@ +package s0221; /** - * Description: these message can be deleted - * Author:sold out + * Author:何正清 * Create Date: 2021/11/16 21:58 - * Version: JDK 1.8 */ public class Solution { public int MaximalSquare(char[][] matrix) { diff --git a/src/s0221/test.java b/src/s0221/test.java index f33033f..36e0d20 100644 --- a/src/s0221/test.java +++ b/src/s0221/test.java @@ -1,10 +1,9 @@ +package s0221; import org.junit.Test; /** - * Description: these message can be deleted - * Author:sold out + * Author:何正清 * Create Date: 2021/11/16 21:58 - * Version: JDK 1.8 */ public class test { diff --git a/src/s0516/Solution.java b/src/s0516/Solution.java index 5ec94be..109ef1d 100644 --- a/src/s0516/Solution.java +++ b/src/s0516/Solution.java @@ -1,8 +1,7 @@ +package s0516; /** - * Description: these message can be deleted - * Author:sold out + * Author:何正清 * Create Date: 2021/11/16 21:58 - * Version: JDK 1.8 */ public class Solution { public int longestPalindromeSubseq(String s) { diff --git a/src/s0516/test.java b/src/s0516/test.java index e44ca53..c427f4d 100644 --- a/src/s0516/test.java +++ b/src/s0516/test.java @@ -1,10 +1,9 @@ +package s0516; import org.junit.Test; /** - * Description: these message can be deleted - * Author:sold out + * Author:何正清 * Create Date: 2021/11/16 21:58 - * Version: JDK 1.8 */ public class test { -- Gitee From 32651fa9234f3443dcbbe9d9f6af10fe387d26be Mon Sep 17 00:00:00 2001 From: hzq Date: Mon, 22 Nov 2021 22:42:09 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=8A=A0=E5=85=A5=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/leetcode1.iml | 11 ----------- src/offer0038/Solution.java | 6 ++++++ src/s0221/Solution.java | 9 +++++++++ src/s0516/Solution.java | 7 +++++++ 4 files changed, 22 insertions(+), 11 deletions(-) delete mode 100644 src/leetcode1.iml diff --git a/src/leetcode1.iml b/src/leetcode1.iml deleted file mode 100644 index b107a2d..0000000 --- a/src/leetcode1.iml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/src/offer0038/Solution.java b/src/offer0038/Solution.java index 312f242..5f43c0e 100644 --- a/src/offer0038/Solution.java +++ b/src/offer0038/Solution.java @@ -5,6 +5,12 @@ package offer0038; */ public class Solution { + /** + * 输入一个字符串,打印出该字符串中的所有排列 你可以以任意顺序返回这个字符数组,但里面不能有重复元素 + * @param resource 给定的某个字符串 + * @return 返回字符串数组 + * 返回例"[ab]","[ba]" + */ public String[] permutation(String resource) { return null; } diff --git a/src/s0221/Solution.java b/src/s0221/Solution.java index 83b0c63..036ce54 100644 --- a/src/s0221/Solution.java +++ b/src/s0221/Solution.java @@ -1,9 +1,18 @@ package s0221; + /** * Author:何正清 * Create Date: 2021/11/16 21:58 */ public class Solution { + + /** + * 在一个由'0'和'1'组成的二维矩阵内,找到只包含'1'的最大正方形,并返回其面积 + * @param matrix 字符类型的二维数组 + * @return 返回matrix数组中, 由'1'组成的最大正方形面积 + * 返回例 1 + * 最小返回 1 + */ public int MaximalSquare(char[][] matrix) { return 0; } diff --git a/src/s0516/Solution.java b/src/s0516/Solution.java index 109ef1d..bf1a17a 100644 --- a/src/s0516/Solution.java +++ b/src/s0516/Solution.java @@ -4,6 +4,13 @@ package s0516; * Create Date: 2021/11/16 21:58 */ public class Solution { + + /** + * 给定一个字符串s,找到其中最长的回文子序列,并返回改序列的长度,可以假设s的长度最大为1000 + * @param s 带查找的数组 + * @return 返回最长的回文子序列的长度 + * 最小返回 1 + */ public int longestPalindromeSubseq(String s) { return 0; } -- Gitee