diff --git a/lesson_10/libraries/src/loaders/loaders.module.ts b/lesson_10/libraries/src/loaders/loaders.module.ts index cfd693ea1..74bdb3ffd 100644 --- a/lesson_10/libraries/src/loaders/loaders.module.ts +++ b/lesson_10/libraries/src/loaders/loaders.module.ts @@ -18,6 +18,7 @@ import { TommyTranLoader } from './tommy_tran_loader.js'; import { XavierCruzLoader } from './xavier_cruz_loader.js'; import { YafiahAbdullahLoader } from './yafiah_abdullah_loader.js'; import { ZionBuchananLoader } from './zion_buchanan_loader.js'; +import { ChigazoGrahamLoader } from './chigazo_graham_loader.js'; export const Loaders = Symbol.for('Loaders'); @@ -26,6 +27,7 @@ const LOADER_PROVIDERS = [ AngelicaCastilloLoader, AnthonyMaysLoader, ChelseaOgbonniaLoader, + ChigazoGrahamLoader, DavidSmithLoader, DwightBlueLoader, HummadTanweerLoader, diff --git a/lesson_12/structs_java/structs_app/src/main/java/com/codedifferently/lesson12/Lesson12.java b/lesson_12/structs_java/structs_app/src/main/java/com/codedifferently/lesson12/Lesson12.java index af7663e90..0782bf69a 100644 --- a/lesson_12/structs_java/structs_app/src/main/java/com/codedifferently/lesson12/Lesson12.java +++ b/lesson_12/structs_java/structs_app/src/main/java/com/codedifferently/lesson12/Lesson12.java @@ -7,6 +7,27 @@ public class Lesson12 { * https://github.com/yang-su2000/Leetcode-algorithm-practice/tree/master/3062-winner-of-the-linked-list-game */ public String gameResult(ListNode head) { - return null; + int evenCounter = 0; //Keeps track of even score + int oddCounter = 0; //Keeps track of odd score + + int evenValue = head.val; //Makes the first even value to compare equal to the first number of the list + int oddValue = head.next.val; //Makes the first odd value to compare equal to the second number of the list + + if ( evenValue > oddValue ) { + evenCounter = evenCounter + 1; + //Compares the even and odd value, adds 1 to even score if even is greater + } else { + oddCounter = ++oddCounter + 1; + } //Compares the even and odd value, adds 1 to odd score if odd is greater + + if (evenCounter > oddCounter) { + return "Even"; + //Compares the even and odd score, prints 'Even' if Evens score is greater + } if (evenCounter < oddCounter) { + return "Odd"; + //Compares the even and odd score, prints 'Odd' if odds score is greater + } else { + return "Tie"; + } //Compares the even and odd score, prints 'Tie' if the two scores are equal } }