Skip to content
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
wants to merge 43 commits into from
Closed

Conversation

vvnsze
Copy link

@vvnsze vvnsze commented Nov 20, 2017

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;
}

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
@vvnsze vvnsze closed this Nov 5, 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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants