##
Count total divisors of A or B in a given range
June 16, 2017

Given four integers m, n, a, b. Find how many integers from range m to n are divisible by a or b. Input: 3 11… Read More »

June 16, 2017

Given four integers m, n, a, b. Find how many integers from range m to n are divisible by a or b. Input: 3 11… Read More »

June 15, 2017

Given a number n and a digit d, count all occurrences of d in range from 0 to n. Examples: Input : n = 25… Read More »

June 14, 2017

After going through previous post, we know what exactly are complex numbers and how we can use them to simulate points in a cartesian plane.… Read More »

While solving geometric problems, it is time consuming to define the point class for specifying a point on the 2D Plane or the Euclidean Plane.… Read More »

Given a range, print all numbers having unique digits. Examples: Input : 10 20 Output : 10 12 13 14 15 16 17 18 19… Read More »

June 13, 2017

Given a value of angle, you need to calculate Sin and Cos values corresponding to it. For sin function Examples: Input : 90 Output :… Read More »

June 12, 2017

Given a number n, write code to find the sum of digits in the factorial of the number. Given n <= 5000 Examples: Input :… Read More »

June 11, 2017

The Fibonacci sequence is defined as = + where = 1 and = 1 are the seeds. For a given prime number p, consider a… Read More »

June 10, 2017

Given n integers, we need to find size of the largest subset with GCD equal to 1. Input Constraint : n <= 10^5 A[i] <=… Read More »

Given one side of right angle triangle, check if there exist a right angle triangle possible with any other two sides of the triangle. If… Read More »

June 9, 2017

Given three integers a, b, n .Your task is to print number of numbers between a and b including them also which have n-divisors. A… Read More »

June 7, 2017

Given a number n, we need to calculate the sum of divisors of factorial of the number. Examples: Input : 4 Output : 60 Factorial… Read More »

June 6, 2017

Given two numbers n and x, we need to calculate the smallest value of x that is closest to given number n. Examples: Input :… Read More »

June 4, 2017

Given a number N, the task is to check whether the number is Automorphic number or not. A number is called Automorphic number if and… Read More »

We know Fibonacci number, Fn = Fn-1 + Fn-2. First few Fibonacci numbers are 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55,… Read More »