## Number of submatrices with all 1s

Given a N*N matrix containing only 0s and 1s, the task is to count the number of submatrices containing all 1s. Examples: Input : arr[][]… Read More »

- Minimum number of swaps required to sort an array | Set 2
- Program to find the Hidden Number
- Number of array elements derivable from D after performing certain operations
- Maximize the value of A by replacing some of its digits with digits of B
- Minimum number of moves to make all elements equal
- Generating numbers that are divisor of their right-rotations
- Minimum no. of operations required to make all Array Elements Zero
- Print array elements in alternatively increasing and decreasing order
- Length of the longest alternating subarray
- Find minimum operations needed to make an Array beautiful
- Check if array can be divided into two sub-arrays such that their absolute difference is K
- Find Sum of pair from two arrays with maximum sum
- Maximum possible time that can be formed from four digits
- Minimize the number of replacements to get a string with same number of 'a', 'b' and 'c' in it
- Choose atleast two elements from array such that their GCD is 1 and cost is minimum
- Generate permutation of 1 to N such that absolute difference of consecutive numbers give K distinct integers
- Subarray whose absolute sum is closest to K
- Minimum changes required to make first string substring of second string
- Number of integral solutions for equation x = b*(sumofdigits(x)^a)+c
- Check if a point lies on or inside a rectangle | Set-2
- Rearrange the string to maximize the number of palindromic substrings
- Intersecting rectangle when bottom-left and top-right corners of two rectangles are given
- Minimum number of operations required to reduce N to 1
- Minimum number of elements to be removed so that pairwise consecutive elements are same
- Length of longest consecutive ones by at most one swap in a Binary String
- Longest Subsequence with at least one common digit in every element
- Check if elements of an array can be arranged in a Circle with consecutive difference as 1
- Balance a string after removing extra brackets
- Number of steps required to convert a binary number to one
- Find the direction from given string

Given a N*N matrix containing only 0s and 1s, the task is to count the number of submatrices containing all 1s. Examples: Input : arr[][]… Read More »

Given an array A containing N elements (N is divisible by 3), the task is to split the numbers into groups of 3, let the… Read More »

Given two strings A and B of equal lengths, the task is to find an index i such that A[0…i] and B[i+1…n-1] give a palindrome… Read More »

Given two strings S1 and S2, you are allowed only to change a character at any position to any vowel if it is a vowel… Read More »

Given an array of N including positive and negative numbers only. The task is to find the length of the longest alternating (means negative-positive-negative or… Read More »

Given two integers A and B, the task is to generate and print a string str such that: str must only contain the characters ‘a’… Read More »

Given a binary tree with N nodes, in which each node value represents number of candies present at that node, and there are N candies… Read More »

Given two string A and B which represents two integers, the task is to print the maximized value of A after replacing 0 or more… Read More »

Given a string str and an integer k. The task is to count the occurrences of sub-strings of length k that consist of the same… Read More »

Given an integer N. You can select any two digits from this number (the digits can be same but their positions should be different) and… Read More »

Given an array arr[] and an integer K, the task is to find whether the array can be divided into two sub-arrays such that the… Read More »

Given two integer arrays arr[] and cost[] where cost[i] is the cost of choosing arr[i]. The task is to choose a subset with at least… Read More »

Given a String of three Colours(G, B, Y) as input, the task is to print the resultant combined colour formed according to the rule given… Read More »

Given a Natural number N and a whole number L, the task is to find the count of numbers, smaller than or equal to N,… Read More »

Given a string consisting of only three possible characters ‘a’, ‘b’ or ‘c’. The task is to replace characters of the given string with ‘a’,… Read More »