Skip to content

Commit d20ab0e

Browse files
JavaScalaDeveloperJavaScalaDeveloper
authored andcommitted
添加所有class的包名
1 parent c7d8828 commit d20ab0e

File tree

2,263 files changed

+14298
-7192
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,263 files changed

+14298
-7192
lines changed

change/scripts/README.md renamed to change/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,6 @@
33

44
[//]: # (- 正则匹配[English Version]([\s\S]*?))
55

6-
- 清除空格
6+
- 清除空格
7+
- 给所有class添加package:AddPackagePrefix
8+
- 合并所有md:MergeMdFiles
Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
1-
class Solution {
2-
public int[] twoSum(int[] nums, int target) {
1+
package com.solution._0001;
2+
import change.datastructure.*;
3+
import change.tools.listnode.ArrayUtils;
4+
5+
import java.util.*;
6+
public class Solution {
7+
public static void main(String[] args) {
8+
int[] arr = {1, 2, 6, 3, 8, 5};
9+
int target = 7;
10+
int[] result = twoSum(arr, target);
11+
System.out.println(ArrayUtils.toList(result));
12+
}
13+
public static int[] twoSum(int[] nums, int target) {
314
Map<Integer, Integer> m = new HashMap<>();
415
for (int i = 0;; ++i) {
516
int x = nums[i];
@@ -10,4 +21,4 @@ public int[] twoSum(int[] nums, int target) {
1021
m.put(x, i);
1122
}
1223
}
13-
}
24+
}

solution/0000-0099/0002.Add Two Numbers/Solution.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@
88
* ListNode(int val, ListNode next) { this.val = val; this.next = next; }
99
* }
1010
*/
11-
class Solution {
11+
package com.solution._0002;
12+
import change.datastructure.*;
13+
import java.util.*;
14+
public class Solution {
1215
public ListNode addTwoNumbers(ListNode l1, ListNode l2) {
1316
ListNode dummy = new ListNode(0);
1417
int carry = 0;
@@ -23,4 +26,4 @@ public ListNode addTwoNumbers(ListNode l1, ListNode l2) {
2326
}
2427
return dummy.next;
2528
}
26-
}
29+
}

solution/0000-0099/0003.Longest Substring Without Repeating Characters/Solution.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
class Solution {
1+
package com.solution._0003;
2+
import change.datastructure.*;
3+
import java.util.*;
4+
public class Solution {
25
public int lengthOfLongestSubstring(String s) {
36
Set<Character> ss = new HashSet<>();
47
int i = 0, ans = 0;
@@ -12,4 +15,4 @@ public int lengthOfLongestSubstring(String s) {
1215
}
1316
return ans;
1417
}
15-
}
18+
}

solution/0000-0099/0004.Median of Two Sorted Arrays/Solution.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
class Solution {
1+
package com.solution._0004;
2+
import change.datastructure.*;
3+
import java.util.*;
4+
public class Solution {
25
public double findMedianSortedArrays(int[] nums1, int[] nums2) {
36
int m = nums1.length;
47
int n = nums2.length;
@@ -24,4 +27,4 @@ private int findKth(int[] nums1, int i, int[] nums2, int j, int k) {
2427
}
2528
return findKth(nums1, i, nums2, j + k / 2, k - k / 2);
2629
}
27-
}
30+
}

solution/0000-0099/0005.Longest Palindromic Substring/Solution.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
class Solution {
1+
package com.solution._0005;
2+
import change.datastructure.*;
3+
import java.util.*;
4+
public class Solution {
25
public String longestPalindrome(String s) {
36
int n = s.length();
47
boolean[][] dp = new boolean[n][n];
@@ -18,4 +21,4 @@ public String longestPalindrome(String s) {
1821
}
1922
return s.substring(start, start + mx);
2023
}
21-
}
24+
}

solution/0000-0099/0006.Zigzag Conversion/Solution.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
class Solution {
1+
package com.solution._0006;
2+
import change.datastructure.*;
3+
import java.util.*;
4+
public class Solution {
25
public String convert(String s, int numRows) {
36
if (numRows == 1) {
47
return s;
@@ -19,4 +22,4 @@ public String convert(String s, int numRows) {
1922
}
2023
return ans.toString();
2124
}
22-
}
25+
}

solution/0000-0099/0007.Reverse Integer/Solution.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
class Solution {
1+
package com.solution._0007;
2+
import change.datastructure.*;
3+
import java.util.*;
4+
public class Solution {
25
public int reverse(int x) {
36
int ans = 0;
47
for (; x != 0; x /= 10) {
@@ -9,4 +12,4 @@ public int reverse(int x) {
912
}
1013
return ans;
1114
}
12-
}
15+
}

solution/0000-0099/0008.String to Integer (atoi)/Solution.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
class Solution {
1+
package com.solution._0008;
2+
import change.datastructure.*;
3+
import java.util.*;
4+
public class Solution {
25
public int myAtoi(String s) {
36
if (s == null) return 0;
47
int n = s.length();
@@ -19,4 +22,4 @@ public int myAtoi(String s) {
1922
}
2023
return sign * res;
2124
}
22-
}
25+
}

solution/0000-0099/0009.Palindrome Number/Solution.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
class Solution {
1+
package com.solution._0009;
2+
import change.datastructure.*;
3+
import java.util.*;
4+
public class Solution {
25
public boolean isPalindrome(int x) {
36
if (x < 0 || (x > 0 && x % 10 == 0)) {
47
return false;
@@ -9,4 +12,4 @@ public boolean isPalindrome(int x) {
912
}
1013
return x == y || x == y / 10;
1114
}
12-
}
15+
}

0 commit comments

Comments
 (0)