Open
Conversation
sycons
approved these changes
Feb 15, 2026
sycons
left a comment
There was a problem hiding this comment.
Well done! You seem to have a good grasp on algorithms and using them in problem solving
- Count values above a threshold ✅
- Write Unit Tests ✅
- Debug and Fix the Logic ✅
- Algorithm performance experiment ✅
|
|
||
| test("should return a single number if the array has only one element", () => { | ||
| expect(calculateAverage([5])).toBe(5); | ||
| }); |
There was a problem hiding this comment.
Another possible test case is null as input.
| console.log(countVowels("Hello World")); // Output: 3 | ||
| console.log(countVowels("JavaScript")); // Output: 3 | ||
| console.log(countVowels("")); // returns 0 | ||
| console.log(countVowels("AEIOU")); // Output: 5 |
There was a problem hiding this comment.
This is a good test. Both the all vowels and uppercase get tested at the same time ⭐
|
|
||
| const bigFirstArray = generateBigArray(1000); | ||
| const bigSecondArray = generateBigArray(100000); | ||
| const bigThirdArray = generateBigArray(10000000); |
| // Example: generateBigArray(1000000) will create an array of 1 million numbers. No newline at end of file | ||
| import generateBigArray from "./bigArray.js"; | ||
|
|
||
| const bigFirstArray = generateBigArray(1000); |
There was a problem hiding this comment.
A more descriptive name might be better. E.g. bigArray1k
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.