Skip to content

Commit 3d76d90

Browse files
rename
1 parent bf94645 commit 3d76d90

File tree

11 files changed

+25
-25
lines changed

11 files changed

+25
-25
lines changed

README.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ Your ideas/fixes/algorithms are more than welcome!
8686
|547|[Friend Circles](https://leetcode.com/problems/friend-circles/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_547.java) | O(n^2) |O(n) | Medium | Union Find
8787
|546|[Remove Boxes](https://leetcode.com/problems/remove-boxes/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_546.java) | O(n^3) |O(n^3) | Hard| DFS, DP
8888
|545|[Boundary of Binary Tree](https://leetcode.com/problems/boundary-of-binary-tree/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_545.java) | O(n) |O(n) | Medium | Recursion
89-
|544|[Output Contest Matches](https://leetcode.com/problems/output-contest-matches/)|[Solution](../master/src/main/java/com/fishercoder/solutions/OutputContestMatches.java) | O(n) |O(n) | Medium | Recursion
89+
|544|[Output Contest Matches](https://leetcode.com/problems/output-contest-matches/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_544.java) | O(n) |O(n) | Medium | Recursion
9090
|543|[Diameter of Binary Tree](https://leetcode.com/problems/diameter-of-binary-tree/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_543.java) | O(n) |O(h) | Easy | Tree/DFS/Recursion
9191
|542|[01 Matrix](https://leetcode.com/problems/01-matrix/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_542.java) | O(m*n) |O(n) | Medium | BFS
9292
|541|[Reverse String II](https://leetcode.com/problems/reverse-string-ii/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_541.java) | O(n) |O(1) | Easy | String
@@ -132,7 +132,7 @@ Your ideas/fixes/algorithms are more than welcome!
132132
|491|[Increasing Subsequences](https://leetcode.com/problems/increasing-subsequences/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_491.java) | O(n!) |O(n) | Medium| Backtracking, DFS
133133
|490|[The Maze](https://leetcode.com/problems/the-maze/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_490.java) | O(m*n) |O(m*n) | Medium| BFS
134134
|488|[Zuma Game](https://leetcode.com/problems/zuma-game/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_488.java) | O(?) |O(?) | Hard | DFS, Backtracking
135-
|487|[Max Consecutive Ones II](https://leetcode.com/problems/max-consecutive-ones-ii/)|[Solution](../master/src/main/java/com/fishercoder/solutions/MaxConsecutiveOnesII.java) | O(n) |O(n) | Medium| Array
135+
|487|[Max Consecutive Ones II](https://leetcode.com/problems/max-consecutive-ones-ii/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_487.java) | O(n) |O(n) | Medium| Array
136136
|486|[Predict the Winner](https://leetcode.com/problems/predict-the-winner/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_486.java) | O(2^n) |O(n^2) | Medium | DP
137137
|485|[Max Consecutive Ones](https://leetcode.com/problems/max-consecutive-ones/)|[Solution](../master/src/main/java/com/fishercoder/solutions/MaxConsecutiveOnes.java) | O(n) |O(1) | Easy| Array
138138
|484|[Find Permutation](https://leetcode.com/problems/find-permutation/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_484.java) | O(n) |O(1) | Medium | Array, String, Greedy
@@ -261,7 +261,7 @@ Your ideas/fixes/algorithms are more than welcome!
261261
|339|[Nested List Weight Sum](https://leetcode.com/problems/nested-list-weight-sum/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_339.java)| O(n)|O(h)) | Easy| DFS
262262
|338|[Counting Bits](https://leetcode.com/problems/counting-bits/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_338.java)| O(nlogn)|O(h) | Medium|
263263
|337|[House Robber III](https://leetcode.com/problems/house-robber-iii/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_337.java)| O(n)|O(n)| Medium | DP
264-
|336|[Palindrome Pairs](https://leetcode.com/problems/palindrome-pairs/)|[Solution](../master/src/main/java/com/fishercoder/solutions/PalindromePairs.java)| O(n^2)|O(n) | Hard|
264+
|336|[Palindrome Pairs](https://leetcode.com/problems/palindrome-pairs/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_336.java)| O(n^2)|O(n) | Hard|
265265
|334|[Increasing Triplet Subsequence](https://leetcode.com/problems/increasing-triplet-subsequence/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_334.java)| O(n^2)|O(1) | Medium|
266266
|333|[Largest BST Subtree](https://leetcode.com/problems/largest-bst-subtree/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_333.java)| O(n)|O(n) | Medium| Tree
267267
|332|[Reconstruct Itinerary](https://leetcode.com/problems/reconstruct-itinerary/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_332.java)| O(n)|O(n) | Medium| Graph, DFS
@@ -330,15 +330,15 @@ Your ideas/fixes/algorithms are more than welcome!
330330
|268|[Missing Number](https://leetcode.com/problems/missing-number/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_268.java)| O(n)|O(1) | Easy| Bit Manipulation
331331
|267|[Palindrome Permutation II](https://leetcode.com/problems/palindrome-permutation-ii/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_267.java)| O(n*n!)|O(n) | Medium|
332332
|266|[Palindrome Permutation](https://leetcode.com/problems/palindrome-permutation/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_266.java)| O(n)|O(1) | Easy|
333-
|265|[Paint House II](https://leetcode.com/problems/paint-house-ii/)|[Solution](../master/src/main/java/com/fishercoder/solutions/PaintHouseII.java)| ?|? | Hard|
333+
|265|[Paint House II](https://leetcode.com/problems/paint-house-ii/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_265.java)| ?|? | Hard|
334334
|264|[Ugly Number II](https://leetcode.com/problems/ugly-number-ii/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_264.java)| O(n)|O(n) | Medium| DP
335335
|263|[Ugly Number](https://leetcode.com/problems/ugly-number/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_263.java)| O(n)|O(1) | Easy|
336336
|261|[Graph Valid Tree](https://leetcode.com/problems/graph-valid-tree/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_261.java)| O(V+E)|O(V+E) | Medium|
337337
|260|[Single Number III](https://leetcode.com/problems/single-number-iii/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_260.java)| O(n)|O(n) | Medium|
338338
|259|[3Sum Smaller](https://leetcode.com/problems/3sum-smaller/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_259.java)| O(n^2)|O(1) | Medium|
339339
|258|[Add Digits](https://leetcode.com/problems/add-digits/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_258.java)| O(1)|O(1) | Easy|
340340
|257|[Binary Tree Paths](https://leetcode.com/problems/binary-tree-paths/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_257.java) | O(n*h) | O(h) | DFS/Recursion
341-
|256|[Paint House](https://leetcode.com/problems/paint-house/)|[Solution](../master/src/main/java/com/fishercoder/solutions/PaintHouse.java) | O(n) | O(1) | Medium| DP
341+
|256|[Paint House](https://leetcode.com/problems/paint-house/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_256.java) | O(n) | O(1) | Medium| DP
342342
|255|[Verify Preorder Sequence in Binary Search Tree](https://leetcode.com/problems/verify-preorder-sequence-in-binary-search-tree/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_255.java) | O(n) | O(h) | Medium| Tree
343343
|254|[Factor Combinations](https://leetcode.com/problems/factor-combinations/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_254.java) | O(nlogn) | O(nlogn) | Medium| Backtracking
344344
|253|[Meeting Rooms II](https://leetcode.com/problems/meeting-rooms-ii/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_253.java) | O(nlogn) | O(h) | Medium| Heap
@@ -364,7 +364,7 @@ Your ideas/fixes/algorithms are more than welcome!
364364
|232|[Implement Queue using Stacks](https://leetcode.com/problems/implement-queue-using-stacks/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_232.java)| O(n)|O(n) | Medium| Stack, Design
365365
|231|[Power of Two](https://leetcode.com/problems/power-of-two/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_231.java)| O(1)|O(1) | Easy|
366366
|230|[Kth Smallest Element in a BST](https://leetcode.com/problems/kth-smallest-element-in-a-bst/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_230.java)| O(n)|O(k) | Medium| Tree
367-
|229|[Majority Element II](https://leetcode.com/problems/majority-element-ii/)|[Solution](../master/src/main/java/com/fishercoder/solutions/MajorityElementII.java)| O(n)|O(n) | Medium|
367+
|229|[Majority Element II](https://leetcode.com/problems/majority-element-ii/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_229.java)| O(n)|O(n) | Medium|
368368
|228|[Summary Ranges](https://leetcode.com/problems/summary-ranges/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_228.java)| O(n)|O(1) | Medium| Array
369369
|227|[Basic Calculator II](https://leetcode.com/problems/basic-calculator-ii/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_227.java)| O(n)|O(n) | Medium| String
370370
|226|[Invert Binary Tree](https://leetcode.com/problems/invert-binary-tree/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_226.java)| O(n)|O(h) | Easy| DFS, recursion
@@ -406,15 +406,15 @@ Your ideas/fixes/algorithms are more than welcome!
406406
|172|[Factorial Trailing Zeroes](https://leetcode.com/problems/factorial-trailing-zeroes/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_172.java)| O(logn)|O(1)| Easy
407407
|171|[Excel Sheet Column Number](https://leetcode.com/problems/excel-sheet-column-number/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_171.java)| O(n)|O(1)| Easy
408408
|170|[Two Sum III - Data structure design](https://leetcode.com/problems/two-sum-iii-data-structure-design/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_170.java)| O(n)|O(n)| Easy
409-
|169|[Majority Element](https://leetcode.com/problems/majority-element/)|[Solution](../master/src/main/java/com/fishercoder/solutions/MajorityElement.java)| O(n)|O(1) | Easy|
409+
|169|[Majority Element](https://leetcode.com/problems/majority-element/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_169.java)| O(n)|O(1) | Easy|
410410
|168|[Excel Sheet Column Title](https://leetcode.com/problems/excel-sheet-column-title/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_168.java)| O(n)|O(1) | Easy|
411411
|167|[Two Sum II - Input array is sorted](https://leetcode.com/problems/two-sum-ii-input-array-is-sorted/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_167.java)| O(logn)|O(1) | Easy|
412412
|166|[Fraction to Recurring Decimal](https://leetcode.com/problems/fraction-to-recurring-decimal/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_166.java) | O(1) |O(1) | Medium| HashMap
413413
|165|[Compare Version Numbers](https://leetcode.com/problems/compare-version-numbers/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_165.java)| O(n)|O(1) | Easy|
414414
|164|[Maximum Gap](https://leetcode.com/problems/maximum-gap/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_164.java) | O(n) |O(n) | Hard|
415415
|163|[Missing Ranges](https://leetcode.com/problems/missing-ranges/)|[Solution](../master/src/main/java/com/fishercoder/solutions/MissingRanges.java) | O(n) |O(1) | |
416416
|162|[Find Peak Element](https://leetcode.com/problems/find-peak-element/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_162.java) | O(1) |O(logn)/O(n) | Binary Search|
417-
|161|[One Edit Distance](https://leetcode.com/problems/one-edit-distance/)|[Solution](../master/src/main/java/com/fishercoder/solutions/OneEditDistance.java) | O(n) |O(1) | |
417+
|161|[One Edit Distance](https://leetcode.com/problems/one-edit-distance/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_161.java) | O(n) |O(1) | |
418418
|160|[Intersection of Two Linked Lists](https://leetcode.com/problems/intersection-of-two-linked-lists/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_160.java)| O(m+n)|O(1) | Easy| Linked List
419419
|159|[Longest Substring with At Most Two Distinct Characters](https://leetcode.com/problems/longest-substring-with-at-most-two-distinct-characters/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_159.java)| O(n)|O(1) | Hard| String, Sliding Window
420420
|158|[Read N Characters Given Read4 II - Call multiple times](https://leetcode.com/problems/read-n-characters-given-read4-ii-call-multiple-times/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_158.java)| O(n)|O(1) | Hard|

src/main/java/com/fishercoder/solutions/OneEditDistance.java src/main/java/com/fishercoder/solutions/_161.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.fishercoder.solutions;
22

33
/**Given two strings S and T, determine if they are both one edit distance apart.*/
4-
public class OneEditDistance {
4+
public class _161 {
55

66
public static boolean isOneEditDistance(String s, String t) {
77
char[] schar = s.toCharArray();

src/main/java/com/fishercoder/solutions/MajorityElement.java src/main/java/com/fishercoder/solutions/_169.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
You may assume that the array is non-empty and the majority element always exist in the array.
1212
1313
*/
14-
public class MajorityElement {
14+
public class _169 {
1515

1616
public int majorityElement_bit_manipulation(int[] nums){
1717
int[] bit = new int[32];//because an integer is 32 bits, so we use an array of 32 long
@@ -46,7 +46,7 @@ public int majorityElement_moore_voting_algorithm(int[] nums){
4646

4747
public static void main(String...strings){
4848
int[] nums = new int[]{1,2,3,4,2,3,2,2,4,2};
49-
MajorityElement test = new MajorityElement();
49+
_169 test = new _169();
5050
System.out.println(test.majorityElement_bit_manipulation(nums));
5151
}
5252

src/main/java/com/fishercoder/solutions/MajorityElementII.java src/main/java/com/fishercoder/solutions/_229.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
How many majority elements could it possibly have?
1414
Do you have a better hint? Suggest it!
1515
*/
16-
public class MajorityElementII {
16+
public class _229 {
1717

1818
public List<Integer> majorityElement(int[] nums) {
1919
Map<Integer, Integer> counterMap = new HashMap<Integer, Integer>();

src/main/java/com/fishercoder/solutions/PaintHouse.java src/main/java/com/fishercoder/solutions/_256.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
Note:
99
All costs are positive integers.
1010
*/
11-
public class PaintHouse {
11+
public class _256 {
1212

1313
public int minCost(int[][] costs) {
1414
if(costs == null || costs.length == 0){

src/main/java/com/fishercoder/solutions/PaintHouseII.java src/main/java/com/fishercoder/solutions/_265.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
Follow up:
1212
Could you solve it in O(nk) runtime?
1313
*/
14-
public class PaintHouseII {
14+
public class _265 {
1515

1616
public int minCostII(int[][] costs) {
1717
if (costs == null || costs.length == 0)

src/main/java/com/fishercoder/solutions/PalindromePairs.java src/main/java/com/fishercoder/solutions/_336.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
Return [[0, 1], [1, 0], [3, 2], [2, 4]]
1515
The palindromes are ["dcbaabcd", "abcddcba", "slls", "llssssll"]
1616
*/
17-
public class PalindromePairs {
17+
public class _336 {
1818

1919
public List<List<Integer>> palindromePairs(String[] words) {
2020
List<List<Integer>> pairs = new ArrayList<List<Integer>>();

src/main/java/com/fishercoder/solutions/MaxConsecutiveOnes.java src/main/java/com/fishercoder/solutions/_487.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
The input array will only contain 0 and 1.
1414
The length of input array is a positive integer and will not exceed 10,000
1515
*/
16-
public class MaxConsecutiveOnes {
16+
public class _487 {
1717

1818
public static int findMaxConsecutiveOnes(int[] nums) {
1919
int maxOnes = 0;

src/main/java/com/fishercoder/solutions/OutputContestMatches.java src/main/java/com/fishercoder/solutions/_544.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Since the third round will generate the final winner, you need to output the ans
4747
The n is in range [2, 212].
4848
We ensure that the input n can be converted into the form 2k, where k is a positive integer.
4949
*/
50-
public class OutputContestMatches {
50+
public class _544 {
5151

5252
public String findContestMatch(int n) {
5353
List<String> pairs = new ArrayList<>();

src/test/java/com/fishercoder/MaxConsecutiveOnesTest.java src/test/java/com/fishercoder/_487Test.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
package com.fishercoder;
22

3-
import com.fishercoder.solutions.MaxConsecutiveOnes;
3+
import com.fishercoder.solutions._487;
44
import org.junit.Before;
55
import org.junit.BeforeClass;
66
import org.junit.Test;
77

88
import static junit.framework.Assert.assertEquals;
99

10-
public class MaxConsecutiveOnesTest {
11-
private static MaxConsecutiveOnes test;
10+
public class _487Test {
11+
private static _487 test;
1212
private static int[] nums;
1313
private static int expected;
1414
private static int actual;
1515

1616
@BeforeClass
1717
public static void setup(){
18-
test = new MaxConsecutiveOnes();
18+
test = new _487();
1919
}
2020

2121
@Before

src/test/java/com/fishercoder/OutputContestMatchesTest.java src/test/java/com/fishercoder/_544Test.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
package com.fishercoder;
22

3-
import com.fishercoder.solutions.OutputContestMatches;
3+
import com.fishercoder.solutions._544;
44
import org.junit.Before;
55
import org.junit.BeforeClass;
66
import org.junit.Test;
77

88
import static junit.framework.TestCase.assertEquals;
99

10-
public class OutputContestMatchesTest {
11-
private static OutputContestMatches test;
10+
public class _544Test {
11+
private static _544 test;
1212
private static int n;
1313
private static String expected;
1414
private static String actual;
1515

1616
@BeforeClass
1717
public static void setup(){
18-
test = new OutputContestMatches();
18+
test = new _544();
1919
}
2020

2121
@Before

0 commit comments

Comments
 (0)