---
title: "#moores-voting-algorithm articles | Hashnode"
description: "Explore 5 articles tagged #moores-voting-algorithm on Hashnode. Tutorials, guides, and how-tos from the community."
url: "https://hashnode.com/tag/moores-voting-algorithm"
---

Tag

# #moores-voting-algorithm

5 posts · 0 followers

[PRANAY JAISWAL](https://hashnode.com/@pranay717) · [Jan 2](https://hashnode.com/posts/everyone-uses-a-hashset-for-leetcode-961-i-found-a-way-to-use-o1-space-by-hacking-moores-voting-algorithm-here-is-the-math-behind-it/69579b40f591e14a80762e07)

### [Everyone uses a HashSet for LeetCode 961. I found a way to use O(1) space by hacking Moore's Voting Algorithm. Here is the math behind it.](https://pranay180825.hashnode.dev/everyone-uses-a-hashset-for-leetcode-961-i-found-a-way-to-use-o1-space-by-hacking-moores-voting-algorithm-here-is-the-math-behind-it?utm_source=hashnode&utm_medium=feed)

LeetCode 961: N-Repeated Element in Size 2N Array is usually solved with a simple Hash Set (O(N) space) or randomized checks. But recently, I challenged myself to solve it deterministically using O(1) space. The result? A modified version of Moore’s ...

3 min read · [pranay180825.hashnode.dev](https://pranay180825.hashnode.dev/everyone-uses-a-hashset-for-leetcode-961-i-found-a-way-to-use-o1-space-by-hacking-moores-voting-algorithm-here-is-the-math-behind-it?utm_source=hashnode&utm_medium=feed)

[Anurag Srivastava](https://hashnode.com/@Javenture) · [Feb 20, 2025](https://hashnode.com/posts/moores-voting-algorithm/67b6b54837c92b848f03fc8a)

### [Moore's Voting Algorithm](https://javenture.hashnode.dev/moores-voting-algorithm?utm_source=hashnode&utm_medium=feed)

Finding the Majority Element: Brute Force vs. Moore's Voting Algorithm The Majority Element problem asks us to find the element that appears more than half the time in a given array. Let's explore two approaches: brute force and Moore's Voting Algori...

2 min read · [javenture.hashnode.dev](https://javenture.hashnode.dev/moores-voting-algorithm?utm_source=hashnode&utm_medium=feed)

[Ujjwal Sharma](https://hashnode.com/@ujjwalsharma) · [Jul 4, 2024](https://hashnode.com/posts/moores-voting-algorithm/6686cad65949ae557f646b38)

### [Moore's Voting Algorithm](https://ujjwalsharma.hashnode.dev/moores-voting-algorithm?utm_source=hashnode&utm_medium=feed)

Working Let the initial length be 1, because we are considering the first element as the initial element in our count. Move forward in the array and if the same element appears again, then increase the count by 1; if not, then decrease the count by...

2 min read · [ujjwalsharma.hashnode.dev](https://ujjwalsharma.hashnode.dev/moores-voting-algorithm?utm_source=hashnode&utm_medium=feed)

[Chetan Datta](https://hashnode.com/@chetan77) · [Oct 23, 2023](https://hashnode.com/posts/229/653680ce7f8067fe0b6cf9f6)

### [229\. Majority Element II - Leetcode](https://chetan77.hashnode.dev/229?utm_source=hashnode&utm_medium=feed)

Problem Problem Link Given an integer array of size n, find all elements that appear more than ⌊ n/3 ⌋ times. Example 1: Input: nums = \[3,2,3\] Output: \[3\] Example 2: Input: nums = \[1\] Output: \[1\] Ex

4 min read · [chetan77.hashnode.dev](https://chetan77.hashnode.dev/229?utm_source=hashnode&utm_medium=feed)

[Chetan Datta](https://hashnode.com/@chetan77) · [Oct 13, 2023](https://hashnode.com/posts/169/652911eaf02453c5528755c4)

### [169\. Majority Element - Moore's Voting Algorithm](https://chetan77.hashnode.dev/169?utm_source=hashnode&utm_medium=feed)

Warfare Intuition

5 min read · [chetan77.hashnode.dev](https://chetan77.hashnode.dev/169?utm_source=hashnode&utm_medium=feed)
