Find minimum number of distinct elements after removing M items

Here, we are going to find the minimum number of distinct elements after removing M number of items from array. Given: An array arr[] of items, an i‘th index element denotes the item id’s and given a number m. Problem: Remove m elements such that there should be minimum distinct id’s left and then print the … Read more

Rearrange Array’s Even and Odd values in Ascending order C++

In this post we will understand the problem of rearranging the array’s even and odd values in Ascending order, then we will discuss the best possible approach and then write a C++ code to implement the solution. Let’s discuss the problem: Given: An array of integers with equal number of even and odd values. Problem: … Read more