Given a positive integer n, write a function to find if it is a power of 2 or not Examples: Input: n = 4 Output:… Read More
Category Archives: Mathematical
What is ‘Compound interest’ ? Compound interest is the addition of interest to the principal sum of a loan or deposit, or in other words, interest… Read More
What is ‘Simple Interest’?Simple interest is a quick method of calculating the interest charge on a loan. Simple interest is determined by multiplying the daily… Read More
Given two variables, x, and y, swap two variables without using a third variable. Method 1 (Using Arithmetic Operators): Example 1: The idea is to… Read More
Given two numbers X and Y (X ≤ Y), you can select any positive integer Z and add them to both X and Y. The… Read More
Given two integers one is a dividend and the other is the divisor, we need to find the quotient when the dividend is divided by… Read More
Given an array arr[] of size N, the task is to count all pair of indices (i, j) such that i < j and j… Read More
Given an array, arr[], and the cost array cost[], the task is to find the minimum cost to make all the array elements equal by… Read More
Given an array arr[] having positive integers of size N, and a non-negative integer K, the task is to find the minimum number of division… Read More
Given a string S of numbers of length N, the task is to find the minimum number of operations required to change a string into… Read More
Given a positive integer N, count the number of possible distinct rearrangements of the digits of N (in decimal representation), such that the resultant number… Read More
A relation is a subset of the cartesian product of a set with another set. A relation contains ordered pairs of elements of the set… Read More
A relation is a subset of the cartesian product of a set with another set. A relation contains ordered pairs of elements of the set… Read More
A relation is a subset of the cartesian product of a set with another set. A relation contains ordered pairs of elements of the set… Read More