更新 test.java

master
wangsiyuan 2023-09-06 16:41:20 +08:00
parent ac72c9bbaa
commit 199077684b
1 changed files with 6 additions and 4 deletions

View File

@ -8,7 +8,7 @@ import java.util.stream.Collectors;
public class test { public class test {
public static void main(String[] args) { public static void main(String[] args) {
// int[] nums1 = new int[]{1,2,3,0,0,0}; int[] nums1 = new int[]{1,2,3,0,0,0};
// int m = 3; // int m = 3;
// int[] nums2 = new int[]{2,5,6}; // int[] nums2 = new int[]{2,5,6};
// int n = 3; // int n = 3;
@ -18,9 +18,11 @@ public class test {
// int n = 0; // int n = 0;
// Solution.merge(nums1,m,nums2,n); // Solution.merge(nums1,m,nums2,n);
// String[] strs = new String[]{"flower","flow","flight"}; // String[] strs = new String[]{"flower","flow","flight"};
String[] strs = new String[]{"flower","flower","flower","flower"}; // String[] strs = new String[]{"flower","flower","flower","flower"};
String result = Solution.longestCommonPrefix(strs); // String result = Solution.longestCommonPrefix(strs);
System.out.println(result); // System.out.println(result);
int m = Solution.majorityElement(nums1);
System.out.println(m);
} }
} }