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

countSetBits implemented #204

Merged
merged 6 commits into from
Oct 21, 2017
Merged

countSetBits implemented #204

merged 6 commits into from
Oct 21, 2017

Conversation

dna113p
Copy link
Contributor

@dna113p dna113p commented Oct 20, 2017

  • Running yarn lint does not trigger any linter errors
  • The test of the method you have fixed is passing
  • You have written a new skeleton method for someone else to work on!
  • You have written tests to accompany your skeleton method

Closes #201

lib/unique.js Outdated
@@ -0,0 +1,8 @@
//Return the number of unique elements in the array
Copy link
Collaborator

@ktilcu ktilcu Oct 20, 2017

Choose a reason for hiding this comment

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

what should we do about complex items in arrays? like objects or other arrays? maybe just use strict equality checking (===)? A test for this situation would be very explanatory. Something like

const omg = {omg:1};
expect(unique([omg, {omg:1}, omg])).toBe(2); // or 1 if you have something else in mind.

would help whoever implements this in the future.

lib/unique.js Outdated
@@ -0,0 +1,8 @@
//Return the number of unique elements in the array

function unique(arr) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe call it uniqueCount?

Copy link
Collaborator

@ktilcu ktilcu left a comment

Choose a reason for hiding this comment

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

Just a quick clarity update requested.

@ktilcu
Copy link
Collaborator

ktilcu commented Oct 21, 2017

@dna113p looks like there are some conflicts. Can you clean those up? I'm looking forward to getting this in for you.

@ktilcu
Copy link
Collaborator

ktilcu commented Oct 21, 2017

@dna113p Thanks for taking the feedback and updating your branch! I'll merge it in. If you could create the issue for your skeleton method that would be very helpful for us.

@ktilcu ktilcu merged commit 64d2d47 into BlakeGuilloud:master Oct 21, 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.

Fix countSetBits function
2 participants