Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3d76d90

Browse files
rename
1 parentbf94645 commit3d76d90

File tree

11 files changed

+25
-25
lines changed

11 files changed

+25
-25
lines changed

‎README.md

Lines changed: 8 additions & 8 deletions
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.javarenamed to‎src/main/java/com/fishercoder/solutions/_161.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
packagecom.fishercoder.solutions;
22

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

66
publicstaticbooleanisOneEditDistance(Strings,Stringt) {
77
char[]schar =s.toCharArray();

‎src/main/java/com/fishercoder/solutions/MajorityElement.javarenamed to‎src/main/java/com/fishercoder/solutions/_169.java

Lines changed: 2 additions & 2 deletions
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-
publicclassMajorityElement {
14+
publicclass_169 {
1515

1616
publicintmajorityElement_bit_manipulation(int[]nums){
1717
int[]bit =newint[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
publicstaticvoidmain(String...strings){
4848
int[]nums =newint[]{1,2,3,4,2,3,2,2,4,2};
49-
MajorityElementtest =newMajorityElement();
49+
_169test =new_169();
5050
System.out.println(test.majorityElement_bit_manipulation(nums));
5151
}
5252

‎src/main/java/com/fishercoder/solutions/MajorityElementII.javarenamed to‎src/main/java/com/fishercoder/solutions/_229.java

Lines changed: 1 addition & 1 deletion
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-
publicclassMajorityElementII {
16+
publicclass_229 {
1717

1818
publicList<Integer>majorityElement(int[]nums) {
1919
Map<Integer,Integer>counterMap =newHashMap<Integer,Integer>();

‎src/main/java/com/fishercoder/solutions/PaintHouse.javarenamed to‎src/main/java/com/fishercoder/solutions/_256.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
Note:
99
All costs are positive integers.
1010
*/
11-
publicclassPaintHouse {
11+
publicclass_256 {
1212

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

‎src/main/java/com/fishercoder/solutions/PaintHouseII.javarenamed to‎src/main/java/com/fishercoder/solutions/_265.java

Lines changed: 1 addition & 1 deletion
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-
publicclassPaintHouseII {
14+
publicclass_265 {
1515

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

‎src/main/java/com/fishercoder/solutions/PalindromePairs.javarenamed to‎src/main/java/com/fishercoder/solutions/_336.java

Lines changed: 1 addition & 1 deletion
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-
publicclassPalindromePairs {
17+
publicclass_336 {
1818

1919
publicList<List<Integer>>palindromePairs(String[]words) {
2020
List<List<Integer>>pairs =newArrayList<List<Integer>>();

‎src/main/java/com/fishercoder/solutions/MaxConsecutiveOnes.javarenamed to‎src/main/java/com/fishercoder/solutions/_487.java

Lines changed: 1 addition & 1 deletion
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-
publicclassMaxConsecutiveOnes {
16+
publicclass_487 {
1717

1818
publicstaticintfindMaxConsecutiveOnes(int[]nums) {
1919
intmaxOnes =0;

‎src/main/java/com/fishercoder/solutions/OutputContestMatches.javarenamed to‎src/main/java/com/fishercoder/solutions/_544.java

Lines changed: 1 addition & 1 deletion
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-
publicclassOutputContestMatches {
50+
publicclass_544 {
5151

5252
publicStringfindContestMatch(intn) {
5353
List<String>pairs =newArrayList<>();

‎src/test/java/com/fishercoder/MaxConsecutiveOnesTest.javarenamed to‎src/test/java/com/fishercoder/_487Test.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
packagecom.fishercoder;
22

3-
importcom.fishercoder.solutions.MaxConsecutiveOnes;
3+
importcom.fishercoder.solutions._487;
44
importorg.junit.Before;
55
importorg.junit.BeforeClass;
66
importorg.junit.Test;
77

88
importstaticjunit.framework.Assert.assertEquals;
99

10-
publicclassMaxConsecutiveOnesTest {
11-
privatestaticMaxConsecutiveOnestest;
10+
publicclass_487Test {
11+
privatestatic_487test;
1212
privatestaticint[]nums;
1313
privatestaticintexpected;
1414
privatestaticintactual;
1515

1616
@BeforeClass
1717
publicstaticvoidsetup(){
18-
test =newMaxConsecutiveOnes();
18+
test =new_487();
1919
}
2020

2121
@Before

‎src/test/java/com/fishercoder/OutputContestMatchesTest.javarenamed to‎src/test/java/com/fishercoder/_544Test.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
packagecom.fishercoder;
22

3-
importcom.fishercoder.solutions.OutputContestMatches;
3+
importcom.fishercoder.solutions._544;
44
importorg.junit.Before;
55
importorg.junit.BeforeClass;
66
importorg.junit.Test;
77

88
importstaticjunit.framework.TestCase.assertEquals;
99

10-
publicclassOutputContestMatchesTest {
11-
privatestaticOutputContestMatchestest;
10+
publicclass_544Test {
11+
privatestatic_544test;
1212
privatestaticintn;
1313
privatestaticStringexpected;
1414
privatestaticStringactual;
1515

1616
@BeforeClass
1717
publicstaticvoidsetup(){
18-
test =newOutputContestMatches();
18+
test =new_544();
1919
}
2020

2121
@Before

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp