# Category Archives: Hash

Given a singly linked list, the task is to Count the pairs of nodes with greater Bitwise AND than Bitwise XOR. Examples: Input: list: 1->4->2->6->3Output:… Read More
Given an array A[] having N positive integers, the task is to perform the following operations and maximize the sum obtained while reducing the array:… Read More
Given an array arr[] of length N, the task is to find the minimum number of operations to change the array such that each arr[i]… Read More
Given an array nums[], and integer K and X, the task is to find the most frequent element K positions away from X in the… Read More
Given an array arr[] of length N the task is to find the minimum number of elements to be added in the array such that… Read More
Given an array arr[] containing positive integers, count the total number of pairs for which arr[i]+i = arr[j]+j such that 0≤i<j≤n-1. Examples: Input: arr[] =… Read More
Given two arrays nums[] of size N and target[]. The task is to find the number of non-empty subarrays of nums[] that do not contain… Read More
Given an array arr[] of size N, the task is to find the minimum value range [L, R] such that: The array can be divided… Read More
Given an array arr[] of size N, and Q queries of the form [A, B], the task is to find all the unique elements from… Read More
Given an array of strings arr[] of size N. Each of the strings contains lowercase English letters or numbers only. The task is to find… Read More
Given an array arr[] of size N, the task is to find the number of pairs of the array upon removing which the mean (i.e.… Read More
Given a text txt[0..n-1] and a pattern pat[0..m-1], write a function search(char pat[], char txt[]) that prints all occurrences of pat[] and its permutations (or… Read More
Given two strings A and B, the task is to find the smallest substring of A having B as a subsequence. If there are multiple… Read More
Given a string str of size N containing all possible characters including integers. Print Kth distinct character from the starting of the given string. If… Read More
Given an array arr[] of N elements, the task is to find the length of the longest increasing subsequence whose adjacent element difference is one. … Read More