## Sorting array elements with set bits equal to K

Given an array of integers and a number . The task is to sort only those elements of the array whose total set bits are… Read More »

- Vector in C++ STL
- Sorting Vector of Pairs in C++ | Set 1 (Sort by first and second)
- vector erase() and clear() in C++
- 2D vector in C++ with user defined size
- Sorting a vector in C++
- Ways to copy a vector in C++
- BFS using STL for competitive coding
- vector::push_back() and vector::pop_back() in C++ STL
- vector insert() function in C++ STL
- Sorting 2D Vector in C++ | Set 1 (By row and column)
- Merge k sorted arrays | Set 2 (Different Sized Arrays)
- vector::empty() and vector::size() in C++ STL
- Check if a given graph is Bipartite using DFS
- Sorting 2D Vector in C++ | Set 3 (By number of columns)
- vector::begin() and vector::end() in C++ STL
- Longest subarray having average greater than or equal to x
- Sorting 2D Vector in C++ | Set 2 (In descending order by row and column)
- vector::front() and vector::back() in C++ STL
- vector :: assign() in C++ STL
- vector : : resize() in C++ STL
- Check if two expressions with brackets are same
- Number of subsets with product less than k
- Delete array elements which are smaller than next or become smaller
- vector::at() and vector::swap() in C++ STL
- Check if two strings have a common substring
- Adding one to number represented as array of digits
- General Tree (Each node can have arbitrary number of children) Level Order Traversal
- std::fill() and fill_n() in C++ STL
- Insert in sorted and non-overlapping interval array
- Ordered Prime Signature

Given an array of integers and a number . The task is to sort only those elements of the array whose total set bits are… Read More »

To determine number of integers in a vector that matches a particular value. We use count in C++ STL // CPP program to count vector… Read More »

A container is a holder object that holds a collection of other objects. They are implemented as class templates, which allows a great flexibility in… Read More »

Given an array, find first and last elements of it. Input: {4, 5, 7, 13, 25, 65, 98} Output: First element: 4 Last element: 98… Read More »

Given a rooted tree and not necessarily binary. The tree contains N nodes, labeled 1 to N. You are given the tree in the form… Read More »

You’re given a number N and a number K. Our task is to find the kth smallest divisor of N. Examples: Input : N =… Read More »

Given a string S. You are allowed two type of operations: Remove a character from the front of the string. Remove a character from the… Read More »

Given an array of N distinct elements, find the minimum number of swaps required to sort the array. Note: The problem is not asking to… Read More »

Given an integer . The task is to find all factors of N print the product of four factors of N such that: Sum of… Read More »

The std::swap function is used to swap two elements where as the std::vector::swap function can swap all elements of two different vector containers. Below are… Read More »

Given N works numbered from 1 to N. Given two arrays D1[] and D2[] of N elements each. Also, each work number W(i) is assigned… Read More »

Given a binary tree represented as parent array, find Lowest Common Ancestor between two nodes ‘m’ and ‘n’. In the above diagram, LCA of 10… Read More »

Given two numbers A and B where 1 <= A <= B. The task is to count the number of pairs whose elements are co-prime… Read More »

Given an array A[] and size of array is N. The task is to delete element of array A[] are in given range L to… Read More »

Given an undirected weighted graph. The task is to find the minimum cost of the path from source node to the destination node via an… Read More »