Skip to content

Commit 448415c

Browse files
author
Mrinal Chauhan
committed
feat: added find majority element in array using Moore's Voting Algorithm
1 parent 8d44461 commit 448415c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Data-Structures/Array/MooreVotingAlgorithm.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,5 @@ const MooreVotingAlgorithm = (arr) => {
3030
}
3131

3232
return count > arr.length / 2 ? candidate : null;
33-
};
33+
};
34+
export { MooreVotingAlgorithm };

0 commit comments

Comments
 (0)