Sunidhi Bansal has Published 1085 Articles

Count numbers which can be constructed using two numbers in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 31-Oct-2020 05:14:58

291 Views

We are provided three numbers X, Y and N ( to define range [1, N] ). The goal is to find all the numbers in the range [1, N] that can be constructed using X and Y only any number of times..For example if X=2 and Y=3. Number 6 can ... Read More

Count pairs from two arrays having sum equal to K in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 31-Oct-2020 05:13:20

317 Views

We are given two arrays Arr1[] and Arr2[] and a number K. The goal is to find unique pairs of elements of both arrays such that their sum is K. Pairs will be of form ( Arr1[i], Arr2[j] ) where Arr1[i]+Arr2[j]==K.We will traverse using two loops for i and j. ... Read More

Count pairs (i,j) such that (i+j) is divisible by both A and B in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 31-Oct-2020 05:11:27

213 Views

We are given variables N, M, A and B. The goal is to find ordered pairs of positive numbers( i, j ) such that their sum is divisible by both A and B. And 1

Count pairs (a, b) whose sum of squares is N (a^2 + b^2 = N) in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 31-Oct-2020 05:09:48

349 Views

We are given a number N. The goal is to find ordered pairs of positive numbers such that the sum of their squares is N.We will do this by finding solutions to the equation a2+ b2 = N. Where a is not more than square root of N and b ... Read More

Count pairs (a, b) whose sum of cubes is N (a^3 + b^3 = N) in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 31-Oct-2020 05:07:58

419 Views

We are given a number N. The goal is to find ordered pairs of positive numbers such that the sum of their cubes is N.We will do this by finding solutions to the equation a3 + b3 = N. Where a is not more than cube root of N and ... Read More

Count ordered pairs with product less than N in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 31-Oct-2020 05:06:07

155 Views

We are given a number N. The goal is to find ordered pairs of positive numbers such that their product is less than N.We will do this by starting from i=1 to i

Count ordered pairs of positive numbers such that their sum is S and XOR is K in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 31-Oct-2020 05:04:21

278 Views

We are given two numbers S and K. The goal is to find ordered pairs of positive numbers such that their sum is S and XOR is K.We will do this by starting from i=1 to i

Count of numbers between range having only non-zero digits whose sum of digits is N and number is divisible by M in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 31-Oct-2020 04:59:30

411 Views

We are provided two numbers START and END to define a range of numbers.The goal is to find all the numbers in the range [START, END] which have no digit as 0 and have sum of digits equal to a given number N. Also the numbers are divisible by MWe ... Read More

Count of numbers from range[L, R] whose sum of digits is Y in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 31-Oct-2020 04:57:09

304 Views

We are provided two numbers START and END to define a range of numbers.The goal is to find all the numbers in the range [START, END] which have sum of digits equal to a given number Y.We will do this by traversing numbers from START to END and for each ... Read More

Count of common multiples of two numbers in a range in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 31-Oct-2020 04:55:08

2K+ Views

We are given two numbers A and B. Also provided two numbers START and END to define a range of numbers. The Ath tile has paint white and Bth tile has paint black. If the tile is painted both black and white then it turns grey. The goal is to ... Read More

Advertisements