Tutorials
Courses
Data Structure
Java
Python
HTML
Interview Preparation
DSA
Practice Problems
C
C++
Java
Python
JavaScript
Data Science
Machine Learning
Courses
Linux
DevOps
SQL
Web Development
System Design
Aptitude
GfG Premium
Similar Topics
Web Technologies
37.4K+ articles
DSA
21.3K+ articles
Misc
8.5K+ articles
Mathematical
7.6K+ articles
Arrays
6.1K+ articles
Competitive Programming
3.1K+ articles
Sorting
1.7K+ articles
Hash
1.2K+ articles
sliding-window
204+ articles
In-house
+ articles
MEX (Minimal Excluded)
14 posts
Recent Articles
Popular Articles
Minimum operations to make the MEX of the given set equal to x
Last Updated: 09 November 2023
Given a set of n integers, perform minimum number of operations (you can insert/delete elements into/from the set) to make the MEX of the set equal to x (that is given).No...
read more
Misc
DSA
Arrays
MEX (Minimal Excluded)
Maximum MEX from all subarrays of length K
Last Updated: 31 October 2023
Given an array arr[] consisting of N distinct integers and an integer K, the task is to find the maximum MEX from all subarrays of length K.The MEX is the smallest positiv...
read more
Mathematical
Hash
Competitive Programming
DSA
Arrays
sliding-window
HashSet
cpp-set
MEX (Minimal Excluded)
Rearrange array elements to maximize the sum of MEX of all prefix arrays
Last Updated: 31 October 2023
Given an array arr[] of size N, the task is to rearrange the array elements such that the sum of MEX of all prefix arrays is the maximum possible.Note: MEX of a sequence i...
read more
Sorting
Mathematical
Competitive Programming
DSA
Arrays
prefix
MEX (Minimal Excluded)
MEX of generated sequence of N+1 integers where ith integer is XOR of (i-1) and K
Last Updated: 31 October 2023
Given two integers N and K, generate a sequence of size N+1 where the ith element is (i-1)⊕K, the task is to find the MEX of this sequence. Here, the MEX of a sequence is ...
read more
Misc
Pattern Searching
Mathematical
DSA
Bitwise-XOR
Sequence and Series
MEX (Minimal Excluded)
Rearrange Array to maximize sum of MEX of all Subarrays starting from first index
Last Updated: 31 October 2023
Given an array arr[] of N elements ranging from 0 to N-1(both included), the task is to rearrange the array such that the sum of all the MEX from every subarray starting f...
read more
Sorting
DSA
Arrays
subarray
MEX (Minimal Excluded)
MEX (Minimum Excluded) in Competitive Programming
Last Updated: 14 February 2025
MEX of a sequence or an array is the smallest non-negative integer that is not present in the sequence.Note: The MEX of an array of size N cannot be greater than N since t...
read more
Competitive Programming
DSA
MEX (Minimal Excluded)
MEX Subarray Count
Last Updated: 08 December 2023
Given an array of size N, each element of the array lies between [0, N-1] i.e., the given array is a permutation. The task is to determine the number of subarrays whose ME...
read more
Competitive Programming
DSA
MEX (Minimal Excluded)
Maximum Sum of Array with given MEX
Last Updated: 12 January 2024
Given 3 integers N, K, and X, the task is to construct an array arr[] with the below conditions:Size of the array = NMEX of the array = KAll array elements should be at mo...
read more
Competitive Programming
DSA
Arrays
MEX (Minimal Excluded)
Maximize the Minimum MEX
Last Updated: 17 December 2023
Given two integers n, m and an array arr[], where arr[i] represent a subarray from index arr[i][0] to arr[i][1]. The task is to construct an array ans[] of size n, such th...
read more
Competitive Programming
DSA
MEX (Minimal Excluded)
Minimizing Total Cost for MEX Reduction
Last Updated: 09 January 2024
Given an array A[] ofN integers perform the following operation till the MEX (Minimum Excluded Element) of the array is greater than 0: Pick any element of the array and r...
read more
Dynamic Programming
Competitive Programming
DSA
Algorithms-Dynamic Programming
MEX (Minimal Excluded)
MEX Sum Count
Last Updated: 29 January 2024
Given a length-N sequence A=(A1,A2 ,…,AN ) consisting of 0, 1, and 2, and a string S of size N consisting of M, E, and X. Find the sum of MEX(Ai, Aj, Ak) over all tuples o...
read more
Strings
Competitive Programming
Picked
Geeks Premier League
DSA
Arrays
Geeks Premier League 2023
MEX (Minimal Excluded)
Minimum Increments to reach the given MEX
Last Updated: 12 March 2024
Given an array arr[] of size N. In one operation, choose any element of the array and increase its value by 1. The task is to determine the minimum operations to make the ...
read more
Competitive Programming
Picked
Geeks Premier League
DSA
Arrays
Geeks Premier League 2023
MEX (Minimal Excluded)
Find the MEX of given XOR sequence
Last Updated: 23 March 2024
Given two integers N and M. The task is to determine the MEX (Minimal Excluded) of the following sequence: N ^ 0, N ^ 1, N ^ 2... N ^ M, where ^ is the Bitwise XOR operato...
read more
Bit Magic
Competitive Programming
Picked
Geeks Premier League
DSA
Geeks Premier League 2023
MEX (Minimal Excluded)
Minimize the sum of MEX by removing all elements of array
Last Updated: 02 April 2024
Given an array of integers arr[] of size N. You can perform the following operation N times: Pick any index i, and remove arr[i] from the array and add MEX(arr[]) i.e., Mi...
read more
Dynamic Programming
Competitive Programming
Picked
DSA
MEX (Minimal Excluded)
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our
Cookie Policy
&
Privacy Policy
Got It !