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

fix common elements count algorithm - Comparison API #28

Merged
merged 2 commits into from
Aug 15, 2023

Conversation

waterflow80
Copy link
Collaborator

closes #27

@waterflow80 waterflow80 changed the title fix common elements count algorithm fix common elements count algorithm - Comparison API Aug 13, 2023
/**
* Return the number of common elements between listA and listB
* Note: Time complexity for this method is about O(n²)*/
public Integer getCommonElementsCount(List<String> listA, List<String> listB) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks correct to me, just need to call it in the compare method!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

@waterflow80 waterflow80 merged commit 0d9c12e into EBIvariation:main Aug 15, 2023
1 check passed
@waterflow80 waterflow80 deleted the update-for-comparison-api branch October 20, 2023 21:24
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.

Common elements count algorithm is not correct - Comparison api
2 participants