# Category Archives: Algorithms

Given integers N and K, the task is to find the maximum possible number an N length sequence of distinct positive integers can have if… Read More
Given an array arr[] of length N and integer X, the task is to count no of subarrays having digit sum equal to X. Examples:… Read More
Given two numbers N and K, the task is to find all valid combinations of at most K numbers that sum up to N such… Read More
Given two numbers N and K, the task is to find the count of all valid combinations of at most K numbers that sum up… Read More
Given a matrix mat[][] having N rows and M columns, the task is to find the minimum distance between two adjacent rows where the distance… Read More
Given an array arr[] of size N, the array can be rotated any number of times such that after rotation, each element of the array… Read More
Given a string str, consisting of lower case English alphabets and digits(0-9),  the task is to print all possible strings in lexicographic order that can… Read More
Given a Binary Tree and an input array. The task is to create an Iterator that utilizes next() and hasNext() functions to perform Inorder traversal… 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
Pre-requisite: Binary Search Bitwise Binary Search algorithm is a modified version of Binary Search based on the following idea: Every number can be represented as… Read More
Given two strings s1 and s2, the task is to find the length of the longest common subsequence with no repeating character. Examples: Input: s1=… Read More
Given a range [L, R), the task is to count the numbers that remain unchanged when rotated 180 degrees clockwise. Examples: Input: L = 0,… Read More
Given two binary strings str1 and str2 each of length N, the task is to split the strings in such a way that the sum… Read More
Given a binary matrix of size N x M, you enter the matrix at cell (0, 0) in the left to the right direction. Whenever… Read More
Given a binary string str of length N and a positive integer X, the task is to maximize the count of X length subarrays consisting… Read More