Sunidhi Bansal has Published 1085 Articles

Count of Numbers in Range where the number does not contain more than K non zero digits in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 29-Jan-2021 08:28:07

351 Views

We are given an integer range starting from the variable let's say start till the variable end and a variable k and the task is to calculate the count of numbers in the range such that the numbers don't have more than 'k' non-zero digits.For ExampleInput - int start = ... Read More

Count of strings that become equal to one of the two strings after one removal in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 29-Jan-2021 08:26:59

499 Views

We are given with two different strings let's say s1 and s2 and the task is to form the string let's say S by combining the unique letters of s1 and s2 and now check whether after removing one character from the string S it is forming a string which ... Read More

Count pairs of non-overlapping palindromic sub-strings of the given string in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 29-Jan-2021 08:26:27

389 Views

We are given an input as a string, the task is to find out the count of pairs of non-overlapping palindromic sub-strings of the given input string. The value of arr[i][j] is true if the substring is a palindrome, otherwise false. We will take combination out of the string and ... Read More

Count Occurrences of Anagrams in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 29-Jan-2021 08:21:33

437 Views

We are given an input as a text stream and a word, and the task is to find out the count of occurrences of anagrams of the word in the given text stream. Anagrams are generated by rearranging letters from a word which ends up being a different word or ... Read More

Count Strictly Increasing Subarrays in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 29-Jan-2021 08:19:05

435 Views

We are given an array containing integer elements and the task is to firstly calculate the subarray out of the given array and then check whether the elements in a subarray are in increasing order or not. If yes, then we will consider the subarray else it will be discarded.The ... Read More

Count numbers in a range having GCD of powers of prime factors equal to 1 in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 29-Jan-2021 08:18:19

146 Views

Given two numbers start and end representing a range of positive integers. The goal is to find the count of all the numbers that lie in range [start, end] and have prime factorization such that all prime factors of that number have powers such that they have GCD as 1.If ... Read More

Count the number of nodes at given level in a tree using BFS in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 29-Jan-2021 08:15:57

1K+ Views

Given an undirected graph containing the nodes of a tree as vertices. The goal is to find the count of nodes at a given level of the tree using BFS( breadth first search ) algorithm.BFS Algorithm:-This algorithm starts traversing the graph/tree level by level. Starting from node at level 0, ... Read More

Count of numbers satisfying m + sum(m) + sum(sum(m)) = N in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 29-Jan-2021 08:12:54

204 Views

Given a number N as input. The goal is to find numbers m upto N that satisfy the following condition. Here N

Count numbers (smaller than or equal to N) with given digit sum in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 29-Jan-2021 08:11:42

2K+ Views

Given a string str containing a number and a sum total as input. The goal is to find numbers upto str that have sum of digits equal to total.Let us understand with examples.For ExampleInput - N=”110”  sum=5Output - Count of numbers smaller than or equal to N with given digit ... Read More

Count sub-matrices having sum divisible 'k' in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 29-Jan-2021 08:09:13

270 Views

Given a row x col matrix as input. The goal is to find all submatrices within the matrix[row][col] such that the sum of elements of that submatrix is divisible by integer k.If the matrix is mat[3][3] and k is 4 then submatrices will be as shown below:- Let us understand with ... Read More

Advertisements