## Find minimum difference between any two elements | Set 2

Given an unsorted array arr[] of size n, the task is to find the minimum difference between any pair in the given array. Input: arr[]… Read More »

- Count pairs in array whose sum is divisible by K
- Find minimum difference between any two elements | Set 2
- Count pairs in an array that hold i+j= arr[i]+arr[j]
- Count sub-arrays whose product is divisible by k
- Count pairs of parentheses sequences such that parentheses are balanced
- Count of pairs of strings which differ in exactly one position
- Count all elements in the array which appears at least K times after their first occurrence
- Queries to check if string B exists as substring in string A
- Maximize the number of sum pairs which are divisible by K
- Minimum cost to modify a string
- Number of subarrays having sum of the form k^m, m >= 0
- Rearrange given string to maximize the occurrence of string t
- Sum of all odd frequency nodes of the Linked List
- Number of pairs from the first N natural numbers whose sum is divisible by K
- Count number of distinct substrings of a given length
- Number of ways in which the substring in range [L, R] can be formed using characters out of the range
- Maximum count of pairs which generate the same sum
- Total distinct pairs of ugly numbers from two arrays
- Print all the sum pairs which occur maximum number of times
- Number of times the given string occurs in the array in the range [l, r]
- Count pairs with average present in the same array
- Total character pairs from two strings, with equal number of set bits in their ascii value
- Check if a given number divides the sum of the factorials of its digits
- Distinct pairs from given arrays (a[i], b[j]) such that (a[i] + b[j]) is a Fibonacci number
- Total distinct pairs from two arrays such that second number can be obtained by inverting bits of first

Given an unsorted array arr[] of size n, the task is to find the minimum difference between any pair in the given array. Input: arr[]… Read More »

Given a string S of length N consisting of lower-case English albhabets and an integer ‘l’, find the number of distinct sub-strings of length ‘l’… Read More »

Given two strings A, B and some queries consisting of an integer i, the task is to check whether the sub-string of A starting from… Read More »

Given two binary strings s and t. The task is to rearrange the string s in such a way that the occurrence of string t… Read More »

Given a linked list, the task is to find the sum of all the odd frequency nodes from the given linked list. Examples: Input: 8… Read More »

Given an array arr[] of N integers where |arr[i] ≤ 1000| for all valid i. The task is to count the pairs of integers from… Read More »

Given two arrays a[] and b[], the task is to count the pairs (a[i], b[j]) such that (a[i] + b[j]) is a Fibonacci number.Note that… Read More »

Given a string str consisting of lower case alphabets only and an integer K. The task is to find the minimum cost to modify the… Read More »

Given an array of strings arr[] and two integers l and r, the task is to find the number of times the given string str… Read More »

Given two arrays arr1[] and arr2[], the task is to take an element from first array (say a) and one element from second array (say… Read More »

Given an integer N, the task is to check whether N divides the sum of the factorials of its digits. Examples: Input: N = 19… Read More »

Given an array arr[] of strings of equal lengths. The task is to calculate the total number of pairs of strings which differ in exactly… Read More »

Given an integer k and an array arr[], the task is to count the number of sub-arrays which have the sum equal to some positive… Read More »

Given two arrays arr1[] and arr2[] of sizes N and M where 0 ≤ arr1[i], arr2[i] ≤ 1000 for all valid i, the task is… Read More »

Given a string S and a range [L, R]. The task is to find the number of ways in which the sub-string in the range… Read More »