## Maximum cost path in an Undirected Graph such that no edge is visited twice in a row

Given an undirected graph having N vertices and M edges and each vertex is associated with a cost and a source vertex S is given.… Read More »

- Product of all Subarrays of an Array
- Sliding Window Maximum : Set 2
- Perfect Sum Problem
- Minimize the maximum difference between adjacent elements in an array
- Median of sliding window in an array
- Eggs dropping puzzle | Set 2
- Minimum number of swaps required to sort an array of first N number
- Efficiently merging two sorted arrays with O(1) extra space and O(NlogN + MlogM)
- Find XOR of all elements in an Array
- Split the given string into Primes : Digit DP
- Number of pairs in an array with the sum greater than 0
- Count of subsets with sum equal to X using Recursion
- Check if sum of Fibonacci elements in an Array is a Fibonacci number or not
- Count of subarrays of an Array having all unique digits
- Check if an array is sorted and rotated using Binary Search
- Maximum number of unique values in the array after performing given operations
- Count of subarrays having exactly K perfect square numbers
- Move all zeroes to end of array using Two-Pointers
- Search an element in a sorted and rotated array with duplicates
- Longest alternating subsequence in terms of positive and negative integers
- Minimum salary hike for each employee such that no employee feels unfair
- How to flatten a Vector of Vectors or 2D Vector in C++
- Count number of increasing sub-sequences : O(NlogN)
- Median of an unsorted array using Quick Select Algorithm
- Longest sub-array with maximum GCD
- Minimize the maximum difference of adjacent elements after at most K insertions
- Maximum LCM among all pairs (i, j) from the given Array
- Minimum number of operations to convert array A to array B by adding an integer into a subarray
- Count of subarrays which start and end with the same element
- Maximum number of overlapping Intervals

Given an undirected graph having N vertices and M edges and each vertex is associated with a cost and a source vertex S is given.… Read More »

Given an array arr[] of positive integers. The task is to reverse a subarray to minimize the sum of elements at even places and print… Read More »

Given an array arr[] of size N, the task is to find the minimum possible sum by extracting the smallest element from any K subsequences… Read More »

Given an array arr[] of N numbers. We can merge two adjacent numbers into one and the cost of merging the two numbers is equal… Read More »

Given two arrays A[] and B[] consisting of N positive integers and a integer M, the task is to find the minimum value of X… Read More »

Given an array arr[] of N integers both positive and negative, our task is to find the number of unordered pairs (x, y) which satisfy… Read More »

Given an array arr[] consisting of N integers, the task is to to modify the array such that arr[index] = index using minimum number of… Read More »

Given an array arr[] of N integers, and a range L to R, the task is to find the total number of elements in the… Read More »

Given two positive integers L and R, the task is to find out the total number of values between range [L, R] such that the… Read More »

Given an array arr[] positive integers, the task is to find the number of ways to convert the array sum even if we are allowed… Read More »

Given an array arr[] consisting of N integers and an integer K, the task is to find the length of longest subsequence with sum equal… Read More »

Given a string S, the task is to find the number of ways to split the given string S into two non-empty palindromic strings. Examples:… Read More »

Given an array arr[], the task is to generate a modified array such that all its elements are maximized by swapping of bits. Examples: Input:… Read More »

Given an array size[] of box sizes, our task is to find the number of boxes left at the end, after putting the smaller sized… Read More »

Given an array arr[] of N elements. The task is to find the length of the longest subarray such that the product of the subarray… Read More »