## Minimum number of edges that need to be added to form a triangle

Given an undirected graph with N vertices and N edges. No two edges connect the same pair of vertices. A triangle is a set of… Read More »

- Sort an array without changing position of negative numbers
- Find maximum xor of k elements in an array
- What is Competitive Programming and How to Prepare for It?
- Why Should I Learn Coding?
- Lexicographically Smallest Topological Ordering
- Find the number of pair of Ideal nodes in a given tree
- Find the minimum number of elements that should be removed to make an array good
- Sum of digits with even number of 1's in their binary representation
- Equal Sum and XOR of three Numbers
- Check which player visits more number of Nodes
- Find the Nth Mosaic number
- Count of integers in a range which have even number of odd digits and odd number of even digits
- Optimally accommodate 0s and 1s from a Binary String into K buckets
- Make the list non-decreasing by changing only one digit of the elements
- Find two vertices of an isosceles triangle in which there is rectangle with opposite corners (0, 0) and (X, Y)
- Print the path between any two nodes of a tree | DFS
- Convert an unbalanced bracket sequence to a balanced sequence
- Nth XOR Fibonacci number
- Write a function to get the intersection point of two Linked Lists | Set 2
- Print all the permutation of length L using the elements of an array | Iterative
- Number of substrings that start with "geeks" and end with "for"
- Print first N terms of Lower Wythoff sequence
- Find a pair (n,r) in an integer array such that value of nPr is maximum
- Check if a cycle of length 3 exists or not in a graph that satisfy a given condition
- Count occurrences of a prime number in the prime factorization of every element from the given range
- Reversing a Queue using another Queue
- Find two disjoint good sets of vertices in a given graph
- Minimum increment or decrement operations required to make the array sorted
- Check if the rows of a binary matrix can be made unique by removing a single column
- Number of Subarrays with positive product

Given an undirected graph with N vertices and N edges. No two edges connect the same pair of vertices. A triangle is a set of… Read More »

Given Q queries and an integer K where each query consists of a range [L, R] and the task is to find the count of… Read More »

Given two arrays A[] and B[]. The second array B[] contains all the elements of A[] except for 1 extra element. The task is to… Read More »

Given an array arr[] of N elements, the task is to find the maximum number of consecutive 1’s in the binary representation of an element… Read More »

Given a range [L, R], the task is to find a pair (X, Y) such that L ≤ X, Y ≤ R and (X |… Read More »

Given a string str, the task is to check whether all the substrings of length ≥ 2 have the number of vowels at least as… Read More »

Remember the day of your childhood memories when first time your parents and friends handover some jigsaw puzzles games to you and you accepted the… Read More »

Given a positive integer X the task is to find an integer Y such that: The count of set bits is Y is equal to… Read More »

Given an integer N, the task is to find the minimum number of coins required to create all the values in the range [1, N].… Read More »

Given a string str consisting of lowercase characters, the task is to check whether the string is divisible by 6 after changing it according to… Read More »

Given an array arr[] of N elements. The good value of an element arr[i] is the number of valid indices j<i such that arr[j] is… Read More »

Given an array arr[] of N positive integers, the task is to find the number of pairs with odd sum and the number of pairs… Read More »

Given an array arr[] of N elements, the task is to find the maximum sum of any subarray of length X such that X >… Read More »

Given a tree with N vertices numbered from 0 to N – 1 where 0 is the root node. The task is to check if… Read More »

Given N students and a total of M sets of question paper where M ≤ N. All the M sets are different and every sets… Read More »