Given an N*M (N + M ≤ 40)matrix mat[][], each cell has some value ranging from 0 to 1018 and an integer K. Find the… Read More
Category Archives: Algorithms
Given an array arr[] of length N. The task is to find the length of the longest subsequence of the array such that the absolute… Read More
Given a string str of length N, and an integer K, the task is to form K different strings by choosing characters from the given… Read More
Given an integer N count the number of values of X such that X⊕N > N, where ⊕ denotes bitwise XOR operation Examples: Input: N =… Read More
Given an array arr[] containing N integers where 0 ≤ A[ i ] ≤ N, the task is to divide the array into two equal… Read More
Given a sentence S and a string B having distinct characters, find a string by joining the words of S according to given conditions:- Choose… Read More
Given an integer N. Find the maximum length sequence containing distinct even integers with sum N. In case, such a sequence does not exist, return… Read More
Given the initial congestion window size cwnd, threshold value ssthresh, connection time rtt and an array arr where arr[i] implies the time when a packet… Read More
Given a binary tree of N nodes. Count the frequency of an integer K in the binary tree. Examples: Input: N = 7, K =… Read More
Given two arrays a[] and b[] and an integer K, the task is to find the length of the longest common subsequence such that sum… Read More
Given a binary tree having N nodes, the task is to find the level having the maximum number of setbits. Note: If two levels have… Read More