Skip to content

Commit 8808ad3

Browse files
rename
1 parent 7658804 commit 8808ad3

File tree

8 files changed

+18
-17
lines changed

8 files changed

+18
-17
lines changed

‎README.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ Your ideas/fixes/algorithms are more than welcome!
7474
|562|[Longest Line of Consecutive One in Matrix](https://leetcode.com/problems/longest-line-of-consecutive-one-in-matrix/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_562.java) | O(m*n) |O(m*n) | Medium | Matrix DP
7575
|561|[Array Partition I](https://leetcode.com/problems/array-partition-i/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_561.java) | O(nlogn) |O(1) | Easy | Array
7676
|560|[Subarray Sum Equals K](https://leetcode.com/problems/subarray-sum-equals-k/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_560.java) | O(n) |O(n) | Medium | Array, HashMap
77-
|557|[Reverse Words in a String III](https://leetcode.com/problems/reverse-words-in-a-string-iii/)|[Solution](../master/src/main/java/com/fishercoder/solutions/ReverseWordsinaStringIII.java) | O(n) |O(n) | Easy | String
77+
|557|[Reverse Words in a String III](https://leetcode.com/problems/reverse-words-in-a-string-iii/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_557.java) | O(n) |O(n) | Easy | String
7878
|556|[Next Greater Element III](https://leetcode.com/problems/next-greater-element-iii/)|[Solution](../master/src/main/java/com/fishercoder/solutions/NextGreaterElementIII.java) | O(n)|O(1)| Medium | String
7979
|555|[Split Concatenated Strings](https://leetcode.com/problems/split-concatenated-strings/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_555.java) | O(n^2) |O(n) | Medium | String
8080
|554|[Brick Wall](https://leetcode.com/problems/brick-wall/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_554.java) | O(n) (n is total number of bricks in the wall) |O(m) (m is width of the wall) | Medium | HashMap
@@ -114,7 +114,7 @@ Your ideas/fixes/algorithms are more than welcome!
114114
|514|[Freedom Trail](https://leetcode.com/problems/freedom-trail/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_514.java) | O(?) |O(?) | Hard | DP
115115
|513|[Find Bottom Left Tree Value](https://leetcode.com/problems/find-bottom-left-tree-value/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_513.java) | O(n) |O(k) | Medium| BFS
116116
|508|[Most Frequent Subtree Sum](https://leetcode.com/problems/most-frequent-subtree-sum/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_508.java) | O(n) |O(n) | Medium| DFS, Tree
117-
|507|[Perfect Number](https://leetcode.com/problems/perfect-number/)|[Solution](../master/src/main/java/com/fishercoder/solutions/PerfectNumber.java) | O(sqrt(n)) |O(1) | Easy| Math
117+
|507|[Perfect Number](https://leetcode.com/problems/perfect-number/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_507.java) | O(sqrt(n)) |O(1) | Easy| Math
118118
|506|[Relative Ranks](https://leetcode.com/problems/relative-ranks/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_506.java) | O(nlogn) |O(n) | Easy|
119119
|505|[The Maze II](https://leetcode.com/problems/the-maze-ii/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_505.java) | O(m*n) |O(m*n) | Medium| BFS
120120
|504|[Base 7](https://leetcode.com/problems/base-7/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_504.java) | O(1) |O(1) | Easy|
@@ -294,7 +294,7 @@ Your ideas/fixes/algorithms are more than welcome!
294294
|304|[Range Sum Query 2D - Immutable](https://leetcode.com/problems/range-sum-query-2d-immutable/)|[Solution](../master/src/main/java/com/fishercoder/solutions/RangeSumQuery2DImmutable.java)| ? | ? |Medium|
295295
|303|[Range Sum Query - Immutable](https://leetcode.com/problems/range-sum-query-immutable/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_303.java)| O(n) | O(1) |Easy|
296296
|302|[Smallest Rectangle Enclosing Black Pixels](https://leetcode.com/problems/smallest-rectangle-enclosing-black-pixels/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_302.java)| ? | O(m*n) | Hard| DFS, BFS
297-
|301|[Remove Invalid Parentheses](https://leetcode.com/problems/remove-invalid-parentheses/)|[Solution](../master/src/main/java/com/fishercoder/solutions/RemoveInvalidParentheses.java)| ? | ? | Hard| BFS
297+
|301|[Remove Invalid Parentheses](https://leetcode.com/problems/remove-invalid-parentheses/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_301.java)| ? | ? | Hard| BFS
298298
|300|[Longest Increasing Subsequence](https://leetcode.com/problems/longest-increasing-subsequence/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_300.java)| O(logn)|O(n) | Medium| DP
299299
|299|[Bulls and Cows](https://leetcode.com/problems/bulls-and-cows/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_299.java)| O(n)|O(1) | Easy|
300300
|298|[Binary Tree Longest Consecutive Sequence](https://leetcode.com/problems/binary-tree-longest-consecutive-sequence/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_298.java)| O(n)|O(n) | Medium | Tree
@@ -329,7 +329,7 @@ Your ideas/fixes/algorithms are more than welcome!
329329
|269|[Alien Dictionary](https://leetcode.com/problems/alien-dictionary/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_269.java)| O(?)|O(?) | Hard| Topological Sort
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/PalindromePermutationII.java)| O(n*n!)|O(n) | Medium|
332-
|266|[Palindrome Permutation](https://leetcode.com/problems/palindrome-permutation/)|[Solution](../master/src/main/java/com/fishercoder/solutions/PalindromePermutation.java)| O(n)|O(1) | Easy|
332+
|266|[Palindrome Permutation](https://leetcode.com/problems/palindrome-permutation/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_266.java)| O(n)|O(1) | Easy|
333333
|265|[Paint House II](https://leetcode.com/problems/paint-house-ii/)|[Solution](../master/src/main/java/com/fishercoder/solutions/PaintHouseII.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|
@@ -418,7 +418,7 @@ Your ideas/fixes/algorithms are more than welcome!
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|
421-
|157|[Read N Characters Given Read4](https://leetcode.com/problems/read-n-characters-given-read4/)|[Solution](../master/src/main/java/com/fishercoder/solutions/ReadNCharactersGivenRead4.java)| O(n)|O(1) | Easy|
421+
|157|[Read N Characters Given Read4](https://leetcode.com/problems/read-n-characters-given-read4/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_157.java)| O(n)|O(1) | Easy|
422422
|156|[Binary Tree Upside Down](https://leetcode.com/problems/binary-tree-upside-down/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_156.java)| O(n)|O(h) | Medium| Tree, Recursion
423423
|155|[Min Stack](https://leetcode.com/problems/min-stack/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_155.java)| O(1)|O(n) | Easy| Stack
424424
|154|[Find Minimum in Rotated Sorted Array II](https://leetcode.com/problems/find-minimum-in-rotated-sorted-array-ii/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_154.java)| O(logn)|O(1) | Hard| Array, Binary Search
@@ -493,7 +493,7 @@ Your ideas/fixes/algorithms are more than welcome!
493493
|83|[Remove Duplicates from Sorted List](https://leetcode.com/problems/remove-duplicates-from-sorted-list/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_83.java)|O(n) |O(1)|Medium| Linked List
494494
|82|[Remove Duplicates from Sorted List II](https://leetcode.com/problems/remove-duplicates-from-sorted-list-ii/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_82.java)|O(n) |O(1)|Medium| Linked List
495495
|81|[Search in Rotated Sorted Array II](https://leetcode.com/problems/search-in-rotated-sorted-array-ii/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_81.java)|O(logn)|O(1)|Medium|Binary Search
496-
|80|[Remove Duplicates from Sorted Array II](https://leetcode.com/problems/remove-duplicates-from-sorted-array-ii/)|[Solution](../master/src/main/java/com/fishercoder/solutions/RemoveDuplicatesfromSortedArrayII.java)|O(n) |O(n)|Medium|
496+
|80|[Remove Duplicates from Sorted Array II](https://leetcode.com/problems/remove-duplicates-from-sorted-array-ii/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_80.java)|O(n) |O(n)|Medium|
497497
|79|[Word Search](https://leetcode.com/problems/word-search/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_79.java)|O(m*n*l) ? |O(m*n)|Medium|Backtracking, DFS
498498
|78|[Subsets](https://leetcode.com/problems/subsets/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_78.java)|O(n^2) ? |O(1)|Medium|Backtracking
499499
|77|[Combinations](https://leetcode.com/problems/combinations/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_77.java)|O(n^2) ? |O(1)|Medium|Backtracking

‎src/main/java/com/fishercoder/solutions/ReadNCharactersGivenRead4.java renamed to ‎src/main/java/com/fishercoder/solutions/_157.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* The problem description is pretty ambiguous, actually the problem means to Keep reading until
1717
* either you have gotten n characters or there is no more characters to read.
1818
*/
19-
public class ReadNCharactersGivenRead4 {
19+
public class _157 {
2020
public int read(char[] buf, int n) {
2121
int index = 0, next= 0;
2222
char[] buffer = new char[4];

‎src/main/java/com/fishercoder/solutions/PalindromePermutation.java renamed to ‎src/main/java/com/fishercoder/solutions/_266.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
Consider the palindromes of odd vs even length. What difference do you notice?
1414
Count the frequency of each character.
1515
If each character occurs even number of times, then it must be a palindrome. How about character which occurs odd number of times?*/
16-
public class PalindromePermutation {
16+
public class _266 {
1717

1818
public boolean canPermutePalindrome(String s) {
1919

‎src/main/java/com/fishercoder/solutions/RemoveInvalidParentheses.java renamed to ‎src/main/java/com/fishercoder/solutions/_301.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"(a)())()" -> ["(a)()()", "(a())()"]
1313
")(" -> [""]
1414
*/
15-
public class RemoveInvalidParentheses {
15+
public class _301 {
1616

1717
public List<String> removeInvalidParentheses(String s)
1818
{

‎src/main/java/com/fishercoder/solutions/PerfectNumber.java renamed to ‎src/main/java/com/fishercoder/solutions/_507.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
Note: The input number n will not exceed 100,000,000. (1e8)
1414
1515
*/
16-
public class PerfectNumber {
16+
public class _507 {
1717

1818
public boolean checkPerfectNumber(int num) {
1919
if (num == 1) return false;

‎src/main/java/com/fishercoder/solutions/ReverseWordsinaStringIII.java renamed to ‎src/main/java/com/fishercoder/solutions/_557.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
Output: "s'teL ekat edoCteeL tsetnoc"
99
Note: In the string, each word is separated by single space and there will not be any extra space in the string.
1010
*/
11-
public class ReverseWordsinaStringIII {
11+
public class _557 {
1212

1313
public String reverseWords(String s) {
1414
StringBuilder stringBuilder = new StringBuilder();
+3-2
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@
99
For example,
1010
Given sorted array nums = [1,1,1,2,2,3],
1111
12-
Your function should return length = 5, with the first five elements of nums being 1, 1, 2, 2 and 3. It doesn't matter what you leave beyond the new length.
12+
Your function should return length = 5,
13+
with the first five elements of nums being 1, 1, 2, 2 and 3. It doesn't matter what you leave beyond the new length.
1314
*/
14-
public class RemoveDuplicatesfromSortedArrayII {
15+
public class _80 {
1516

1617
public int removeDuplicates(int[] nums) {
1718
int counter = 0;

‎src/test/java/com/fishercoder/PerfectNumberTest.java renamed to ‎src/test/java/com/fishercoder/_507Test.java

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

3-
import com.fishercoder.solutions.PerfectNumber;
3+
import com.fishercoder.solutions._507;
44
import org.junit.Before;
55
import org.junit.BeforeClass;
66
import org.junit.Test;
@@ -10,15 +10,15 @@
1010
/**
1111
* Created by fishercoder on 1/25/17.
1212
*/
13-
public class PerfectNumberTest {
14-
private static PerfectNumber test;
13+
public class _507Test {
14+
private static _507 test;
1515
private static boolean expected;
1616
private static boolean actual;
1717
private static int num;
1818

1919
@BeforeClass
2020
public static void setup(){
21-
test = new PerfectNumber();
21+
test = new _507();
2222
}
2323

2424
@Before

0 commit comments

Comments
 (0)