-
Notifications
You must be signed in to change notification settings - Fork 3
Version 1 #4
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
base: main
Are you sure you want to change the base?
Version 1 #4
Conversation
Tortuga-AM
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well done! Overall really good. Left a couple style changes or recommendations. No need to implement them just for reference.
| */ | ||
| public static int[] fizzbuzz(int[] arr) { | ||
| return null; | ||
| int [] array = {0, 0, 0}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Common practice is int[]
| return null; | ||
| int [] array = {0, 0, 0}; | ||
| for (int num : arr) { | ||
| if (num % 3 == 0 && num % 5 == 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Recommend more parentheses for clarity
| // Your code goes here | ||
| return false; | ||
| boolean prime = true; | ||
| for (double i = 2; i <= Math.sqrt(n); i++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
int i = 2;
| boolean prime = true; | ||
| for (double i = 2; i <= Math.sqrt(n); i++) { | ||
| if (n % i == 0) { | ||
| prime = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can return prime here because you know it's value
| boolean cd1 = false; | ||
| boolean cd2 = false; | ||
| boolean cd3 = false; | ||
| boolean cd4 = false; | ||
| boolean cdLength = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Recommend better variable names
version 1