File tree 1 file changed +13
-1
lines changed
src/main/java/com/sbaars/adventofcode/year15/days 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ public static void main(String[] args) {
20
20
Day13 day = new Day13 ();
21
21
day .printParts ();
22
22
new com .sbaars .adventofcode .network .Submit ().submit (day .part1 (), 2015 , 13 , 1 );
23
+ new com .sbaars .adventofcode .network .Submit ().submit (day .part2 (), 2015 , 13 , 2 );
23
24
}
24
25
25
26
private void parseInput () {
@@ -49,7 +50,18 @@ public Object part1() {
49
50
50
51
@ Override
51
52
public Object part2 () {
52
- return 0 ; // Implement in next part
53
+ // Add myself to the list with happiness 0 for all relationships
54
+ String me = "Me" ;
55
+ Map <String , Integer > myHappiness = new HashMap <>();
56
+ for (String person : people ) {
57
+ myHappiness .put (person , 0 );
58
+ happinessMap .get (person ).put (me , 0 );
59
+ }
60
+ happinessMap .put (me , myHappiness );
61
+ people .add (me );
62
+
63
+ List <String > peopleList = new ArrayList <>(people );
64
+ return findMaxHappiness (peopleList );
53
65
}
54
66
55
67
private int findMaxHappiness (List <String > peopleList ) {
You can’t perform that action at this time.
0 commit comments