Sunidhi Bansal has Published 1085 Articles

Count of Numbers in Range where first digit is equal to last digit of the number in C++

Sunidhi Bansal

Sunidhi Bansal

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

508 Views

Given a range of numbers between start and end. The goal is to find the count of numbers that have the first digit equal to the last digit and fall in the range [ first, last ].All single digit numbers will be counted if they lie in the range.Let us ... Read More

Count of n digit numbers whose sum of digits equals to given sum in C++

Sunidhi Bansal

Sunidhi Bansal

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

410 Views

Given a positive number as the number of digits and a sum. The goal is to find all d digit numbers that have sum of digits equal to the input sum. The numbers having leading zeros will not be considered as d digit numbers.The ranges are digits between 1 to ... Read More

Count of alphabets whose ASCII values can be formed with the digits of N in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 29-Jan-2021 08:03:53

278 Views

Given a long variable containing a positive number as input. The goal is to find the count of alphabets whose ASCII value digits are present in the digits of the number.Pick any two digits from the number and arrange them in a manner such that they form an ASCII value ... Read More

Count of different ways to express N as the sum of 1, 3 and 4 in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 29-Jan-2021 08:01:56

815 Views

Given a positive number N as input. The goal is to find the number of ways in which we can express N as a sum of 1s, 3s and 4s only. For example, if N is 4 then it can be represented as 1+1+1+1, 3+1, 1+3, 4 so the number ... Read More

Count of cells in a matrix which give a Fibonacci number when the count of adjacent cells is added in C++

Sunidhi Bansal

Sunidhi Bansal

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

128 Views

Given a matrix [ ][ ] having dimensions as row x col. The goal is to find the count of cells of matrix that meet the given condition:Value of cell matrix [i][j] + no. of adjacent cells to it = a Fibonacci numberNumbers in Fibonacci series:- 0, 1, 1, 2, ... Read More

Count of a, b & c after n seconds for given reproduction rate in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 29-Jan-2021 07:55:46

126 Views

Given three numbers 'a', 'b' and 'c' as input. The goal is to find the count/value of 'a', 'b' and 'c' after n seconds such that the rate of reproductions are:-Every a changes to b after every 2 secondsEvery b changes to c after every 5 secondsEvery c changes to ... Read More

Count Numbers in Range with difference between Sum of digits at even and odd positions as Prime in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 29-Jan-2021 07:54:13

289 Views

Given two numbers start and end as range variables. The goal is to find the count of numbers that lie in this range [start, end] and have a difference of sum of digits at even and sum of digits at odd positions as Prime.That is (sum of digits at even ... Read More

Count numbers in range such that digits in it and it's product with q are unequal in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 29-Jan-2021 07:52:20

175 Views

Given two numbers start and end as range variables and an integer q as input. The goal is to find the numbers within a range such that the number and its product with q have no common digits.If the number is 5 and q is 3 then the product will ... Read More

Count number of ways to reach destination in a Maze in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 29-Jan-2021 07:50:39

539 Views

Given a Maze represented as a row X col matrix in which the obstacle is represented as -1 and a clear cell has value other than -1. The goal is to start from the first cell arr[0][0] and reach the last cell arr[row][col] such that only two moves are allowed:Right ... Read More

Count number of ways to reach a given score in a Matrix in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 29-Jan-2021 07:50:01

180 Views

Given a square matrix[][] containing non negative numbers as its elements. Also given a variable score. The goal is to count the ways to reach the given score by adding elements from matrix[][] such that only moves allowed are right moves and down moves. Starting from matrix[0][0] only moves can be, ... Read More

Advertisements