Skip to content

Chigazo Lesson 12.java #412

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 30 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
887b8f0
Merge pull request #1 from code-differently/main
A1-4U2T1NN Sep 26, 2024
05ad627
Merge branch 'code-differently:main' into main
A1-4U2T1NN Sep 27, 2024
5715b6a
Merge branch 'code-differently:main' into main
A1-4U2T1NN Sep 30, 2024
6c909b0
Merge branch 'code-differently:main' into main
A1-4U2T1NN Sep 30, 2024
4c1a3f2
Merge branch 'code-differently:main' into main
A1-4U2T1NN Sep 30, 2024
de19403
Merge branch 'code-differently:main' into main
A1-4U2T1NN Sep 30, 2024
56aa83d
Merge branch 'code-differently:main' into main
A1-4U2T1NN Oct 1, 2024
8529105
Merge branch 'code-differently:main' into main
A1-4U2T1NN Oct 2, 2024
4f76813
Merge branch 'code-differently:main' into main
A1-4U2T1NN Oct 3, 2024
48bf962
Merge branch 'code-differently:main' into main
A1-4U2T1NN Oct 5, 2024
1da88b9
Merge branch 'code-differently:main' into main
A1-4U2T1NN Oct 7, 2024
3068765
Merge branch 'code-differently:main' into main
A1-4U2T1NN Oct 9, 2024
712efd6
Merge branch 'code-differently:main' into main
A1-4U2T1NN Oct 11, 2024
5db7413
Merge branch 'code-differently:main' into main
A1-4U2T1NN Oct 11, 2024
5096f8e
Merge branch 'code-differently:main' into main
A1-4U2T1NN Oct 12, 2024
09341aa
Merge branch 'code-differently:main' into main
A1-4U2T1NN Oct 14, 2024
a8f634e
Merge branch 'code-differently:main' into main
A1-4U2T1NN Oct 15, 2024
b643a4c
feat: created chigazograham.json file
Oct 16, 2024
cae2152
Merge branch 'code-differently:main' into main
A1-4U2T1NN Oct 16, 2024
68ccb5f
fix: deleted lesson_09 content from main;
Oct 16, 2024
7d4f86f
Merge branch 'code-differently:main' into main
A1-4U2T1NN Oct 16, 2024
473eb98
Merge branch 'code-differently:main' into main
A1-4U2T1NN Oct 17, 2024
1d19106
Merge branch 'code-differently:main' into main
A1-4U2T1NN Oct 17, 2024
bba5af5
Merge branch 'code-differently:main' into main
A1-4U2T1NN Oct 18, 2024
a51c852
Merge branch 'code-differently:main' into main
A1-4U2T1NN Oct 19, 2024
8a39fcc
Merge branch 'code-differently:main' into main
A1-4U2T1NN Oct 21, 2024
89197d2
feat: created lesson 12 game result counter; added comments explainin…
Oct 23, 2024
fa89c85
chore: updated branch
Oct 23, 2024
8f5d81c
fix: corrected lesson 10 changes;
Oct 23, 2024
9ddee1b
fix: trying to fix accidental lesson 10 merge edits
Oct 23, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lesson_10/libraries/src/loaders/loaders.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand All @@ -26,6 +27,7 @@ const LOADER_PROVIDERS = [
AngelicaCastilloLoader,
AnthonyMaysLoader,
ChelseaOgbonniaLoader,
ChigazoGrahamLoader,
DavidSmithLoader,
DwightBlueLoader,
HummadTanweerLoader,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Loading