Skip to content

Category Archives: Python Programs

Given an array arr of integers of size n. We need to compute sum of elements from index i to index j. The queries consisting… Read More
Simple interest formula is given by: Simple Interest = (P x T x R)/100 Where, P is the principle amount T is the time and… Read More
Given a long integer, we need to find if the difference between sum of odd digits and sum of even digits is 0 or not.… Read More
Given a number, find minimum sum of its factors.Examples:   Input : 12 Output : 7 Explanation: Following are different ways to factorize 12 and sum… Read More
The Stooge sort is a recursive sorting algorithm. It is defined as below (for ascending order sorting). Step 1 : If value at index 0… Read More
The GCD of three or more numbers equals the product of the prime factors common to all the numbers, but it can also be calculated… Read More
Insertion sort is a simple sorting algorithm that works the way we sort playing cards in our hands. Below is an iterative algorithm for insertion sortAlgorithm … Read More
Cycle sort is an in-place sorting Algorithm, unstable sorting algorithm, a comparison sort that is theoretically optimal in terms of the total number of writes… Read More
Given two integers n and k. Find position the n\’th multiple of K in the Fibonacci series. Examples: Input : k = 2, n = 3… Read More
We have N coins which need to arrange in form of a triangle, i.e. first row will have 1 coin, second row will have 2… Read More
Given two integer numbers, the task is to find count of all common divisors of given numbers? Input : a = 12, b = 24… Read More
Problem: Given an array arr[] of n elements, write a function to search a given element x in arr[]. Examples : Input : arr[] =… Read More
Given a range [n,m], find the number of elements that have odd number of factors in the given range (n and m inclusive). Examples: Input… Read More
Given a number x, determine whether the given number is Armstrong number or not. A positive integer of n digits is called an Armstrong number… Read More
BogoSort also known as permutation sort, stupid sort, slow sort, shotgun sort or monkey sort is a particularly ineffective algorithm based on generate and test… Read More

Start Your Coding Journey Now!