# Tag Archives: maths-perfect-square

## Subsets of size K with product equal to difference of two perfect squares

Given a distinct integers array arr[] of size N and an integer K, the task is to count the number of subsets of size K… Read More »

## Sum of all perfect square divisors of numbers from 1 to N

Given a number N, the task is to find the sum of all the perfect square divisors of numbers from 1 to N. Examples: Input:… Read More »

## Construct an Array such that cube sum of all element is a perfect square

Given the size of array N, the task is to construct an array of size N with positive integer elements such that the cube sum… Read More »

## Count of subarrays whose sum is a perfect square

Given an array arr[] with positive and negative elements, the task is to count all subarrays whose sum is a perfect square. Examples: Input: arr[]… Read More »

## Construct an Array of size N whose sum of cube of all elements is a perfect square

Given an integer N, the tasks is to construct a sorted array arr[] of size N, such that the sum of cube of all elements… Read More »

## Find the Largest N digit perfect square number in Base B

Given two integers N and B, the task is to find the largest N digit numbers of Base B which is a perfect square. Examples:… Read More »

## Check if N can be represented as sum of squares of two consecutive integers

Given an integer N, the task is to check whether N can be represented as a sum of squares of two consecutive integers or not.… Read More »

## Check if a given number is a Perfect square using Binary Search

Check if a given number N is a perfect square or not. If yes then return the number of which it is a perfect square,… Read More »

## Array range queries to find the number of perfect square elements with updates

Given an array arr[] of N integers, the task is to perform the following two queries:  query(start, end): Print the number of perfect square numbers… Read More »

## Count of perfect squares of given length

Given an integer N, the task is to find the number of perfect squares of length N. Examples: Input: N = 1 Output: 3 Explanation:… Read More »

## Sunny Number

Given a positive integer N, the task is to check whether the given number N is Sunny Number or not. A number N is a… Read More »

## Count of subarrays having exactly K perfect square numbers

Given a unsorted integer array arr[] and an integer K. The task is to count the number of subarray with exactly K Perfect Square Numbers.… Read More »

## Probability of getting a perfect square when a random number is chosen in a given range

Given two integers L and R that denote a range, the task is to find the probability of getting a perfect square number when a… Read More »

## Previous perfect square and cube number smaller than number N

Given an integer N, the task is to find the previous perfect square or perfect cube smaller than the number N. Examples: Input: N =… Read More »

## Check whether a number can be represented as difference of two squares

Given a number N, the task is to check if this number can be represented as the difference of two perfect squares or not. Examples:… Read More »