## Number of subarrays having sum of the form k^m, m >= 0

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 »

- Find minimum difference between any two elements | Set 2
- Minimum cost to modify a string
- Queries to check if string B exists as substring in string A
- Count number of distinct substrings of a given length
- Count of pairs of strings which differ in exactly one position
- Count number of pairs in array having sum divisible by K | SET 2
- Find the number of p-sided squares in a grid with K blacks painted
- Sum of all odd frequency nodes of the Linked List
- Number of subarrays having sum of the form k^m, m >= 0
- Rearrange given string to maximize the occurrence of string t
- Total distinct pairs of ugly numbers from two arrays
- Number of ways in which the substring in range [L, R] can be formed using characters out of the range
- Number of times the given string occurs in the array in the range [l, r]
- Distinct pairs from given arrays (a[i], b[j]) such that (a[i] + b[j]) is a Fibonacci number
- Count pairs with average present in the same array
- Total distinct pairs from two arrays such that second number can be obtained by inverting bits of first
- Check if a given number divides the sum of the factorials of its digits
- Kotlin Hashmap

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 »

Given an integer K and an array arr[], the task is to count all the sub-arrays whose product is divisible by K. Examples: Input: arr[]… Read More »

Given an array arr[], the task is to count maximum count of pairs which give the same sum. Examples: Input: arr[] = {1, 2, 3,… Read More »

Given the integer values of N and K. The task is to find the number of pairs from the set of natural numbers up to… Read More »

Given an array A[] and positive integer K, the task is to count total number of pairs in the array whose sum is divisible by… Read More »

Given an array of N integers and an integer K. The task is to print the maximum number of pairs(a[i]+a[j]) possible which are divisible by… Read More »

Given an array arr[] of N distinct integers. The task is to find the sum of two array integers a[i] + a[j] which occurs maximum… Read More »

Given two strings s1 and s2. The task is to take one character from first string and one character from second string and check if… Read More »

Given an array arr[] of N integer elements and an integer K. The task is to count all distinct arr[i] such that arr[i] appears at… Read More »

Given N bracket sequences, the task is to find the number of pairs of bracket sequences by joining which can be obtained a balanced bracket… Read More »

Given an array of integers arr[], the task is to count all the pairs (arr[i], arr[j]) such that i + j = arr[i] + arr[j]… Read More »

Given an array arr[], the task is to find the sum of all those elements from the given array whose square root is present in… Read More »

Merkle tree also known as hash tree is a data structure used for data verification and synchronization. It is a tree data structure where each… Read More »