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
update tests for maxChar #3
Closed
Closed
Conversation
This file contains 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
marufsiddiqui
pushed a commit
to marufsiddiqui/AlgoCasts
that referenced
this pull request
Dec 10, 2017
marufsiddiqui
pushed a commit
to marufsiddiqui/AlgoCasts
that referenced
this pull request
Dec 11, 2017
ryanscottjohnson
referenced
this pull request
in ryanscottjohnson/AlgoCasts
Aug 20, 2018
codedawi
pushed a commit
to codedawi/udemy-algo-casts
that referenced
this pull request
Mar 26, 2019
foxlioncode
added a commit
to foxlioncode/AlgoCasts
that referenced
this pull request
Jan 2, 2020
- .reduce() helper used.
foxlioncode
added a commit
to foxlioncode/AlgoCasts
that referenced
this pull request
Jan 2, 2020
- .reduce() helper used. - TODO formatting added to comments.
foxlioncode
added a commit
to foxlioncode/AlgoCasts
that referenced
this pull request
Jan 5, 2020
- .reduce() helper used. - TODO formatting added to comments.
RadenAR
added a commit
to RadenAR/AlgoCasts
that referenced
this pull request
Jun 11, 2020
chay-chay
added a commit
to chay-chay/AlgoCasts-Fork
that referenced
this pull request
May 7, 2021
robbysingh23
referenced
this pull request
in robbysingh23/AlgoCasts
May 9, 2021
shiva2021
added a commit
to shiva2021/AlgoCasts
that referenced
this pull request
Jun 20, 2021
pouryourlove
added a commit
to pouryourlove/AlgoCasts
that referenced
this pull request
Dec 12, 2022
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.
Improving test coverage because of incorrect solution that was passing all the tests.
I input 'cacacbb' and the output is 'b' when it should be 'c'.
This was the faulty solution that passed the tests:
function maxChar(str) {
var letter;
var count = 0;
str.split('').forEach((item, index) => {
if(letter === undefined || item === letter) {
letter = item;
count++;
} else {
if(count === 1){
letter = item
}
}
})
return letter;
}