This repository was archived by the owner on Dec 1, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
161 additions
and
8 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
src/main/java/lol/hub/aoc/y2022/day3/RucksackReorganization1.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package lol.hub.tuples; | ||
|
||
/** | ||
* Tuple length = 9 | ||
*/ | ||
public record Nonuple<T>(T a, T b, T c, T d, T e, T f, T g, T h, T i) { | ||
public Nonuple(T[] arr) { | ||
this(arr[0], arr[1], arr[2], arr[3], arr[4], arr[5], arr[6], arr[7], arr[8]); | ||
} | ||
|
||
public T left() { | ||
return a; | ||
} | ||
|
||
public T center() { | ||
return e; | ||
} | ||
|
||
public T right() { | ||
return i; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package lol.hub.tuples; | ||
|
||
/** | ||
* Tuple length = 8 | ||
*/ | ||
public record Octuple<T>(T a, T b, T c, T d, T e, T f, T g, T h) { | ||
public Octuple(T[] arr) { | ||
this(arr[0], arr[1], arr[2], arr[3], arr[4], arr[5], arr[6], arr[7]); | ||
} | ||
|
||
public T left() { | ||
return a; | ||
} | ||
|
||
public T right() { | ||
return h; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package lol.hub.tuples; | ||
|
||
/** | ||
* Tuple length = 2 | ||
*/ | ||
public record Pair<T>(T a, T b) { | ||
public Pair(T[] arr) { | ||
this(arr[0], arr[1]); | ||
} | ||
|
||
public T left() { | ||
return a; | ||
} | ||
|
||
public T right() { | ||
return b; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package lol.hub.tuples; | ||
|
||
/** | ||
* Tuple length = 4 | ||
*/ | ||
public record Quartet<T>(T a, T b, T c, T d) { | ||
public Quartet(T[] arr) { | ||
this(arr[0], arr[1], arr[2], arr[3]); | ||
} | ||
|
||
public T left() { | ||
return a; | ||
} | ||
|
||
public T right() { | ||
return d; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package lol.hub.tuples; | ||
|
||
/** | ||
* Tuple length = 5 | ||
*/ | ||
public record Quintuple<T>(T a, T b, T c, T d, T e) { | ||
public Quintuple(T[] arr) { | ||
this(arr[0], arr[1], arr[2], arr[3], arr[4]); | ||
} | ||
|
||
public T left() { | ||
return a; | ||
} | ||
|
||
public T center() { | ||
return c; | ||
} | ||
|
||
public T right() { | ||
return e; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package lol.hub.tuples; | ||
|
||
/** | ||
* Tuple length = 7 | ||
*/ | ||
public record Septuple<T>(T a, T b, T c, T d, T e, T f, T g) { | ||
public Septuple(T[] arr) { | ||
this(arr[0], arr[1], arr[2], arr[3], arr[4], arr[5], arr[6]); | ||
} | ||
|
||
public T left() { | ||
return a; | ||
} | ||
|
||
public T center() { | ||
return d; | ||
} | ||
|
||
public T right() { | ||
return g; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package lol.hub.tuples; | ||
|
||
/** | ||
* Tuple length = 6 | ||
*/ | ||
public record Sextuple<T>(T a, T b, T c, T d, T e, T f) { | ||
public Sextuple(T[] arr) { | ||
this(arr[0], arr[1], arr[2], arr[3], arr[4], arr[5]); | ||
} | ||
|
||
public T left() { | ||
return a; | ||
} | ||
|
||
public T right() { | ||
return f; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package lol.hub.tuples; | ||
|
||
/** | ||
* Tuple length = 3 | ||
*/ | ||
public record Triple<T>(T a, T b, T c) { | ||
public Triple(T[] arr) { | ||
this(arr[0], arr[1], arr[2]); | ||
} | ||
|
||
public T left() { | ||
return a; | ||
} | ||
|
||
public T center() { | ||
return b; | ||
} | ||
|
||
public T right() { | ||
return c; | ||
} | ||
} |