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

Test & Solution for #31. #99

Merged
merged 1 commit into from
Jun 15, 2017
Merged

Test & Solution for #31. #99

merged 1 commit into from
Jun 15, 2017

Conversation

seemcat
Copy link
Contributor

@seemcat seemcat commented Jun 9, 2017

No description provided.

test/31.js Outdated
@@ -18,4 +19,20 @@ describe('longest string in an array', () => {
it('the longest string in [just] is just', () => {
expect(solution(['just'])).eql('just');
})
it.only('the longest string in [hi,hello,hola] is hello', () => {
expect(solution1(['hi','hello','hola'])).eql('hello');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of creating 5 literally duplicate test cases, could you just take advantage of the test cases already written?

solutions/31.js Outdated
while(i < arr.length){
if (big.length < arr[i].length){
big = arr[i];
i++;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should only need one i++

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved. Thanks!

@yjlim5 yjlim5 merged commit 4b177b3 into llipio:master Jun 15, 2017
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.

3 participants