## Program to find area of a circle

Area of a circle can simply be evaluated using following formula. Area = pi * r2 where r is radius of circle Recommended: Please solve… Read More »

- Must do Math for Competitive Programming
- Product of all Subarrays of an Array
- Perfect Sum Problem
- How is the time complexity of Sieve of Eratosthenes is n*log(log(n))?
- Pi(π) in C++ with Examples
- Check whether a number can be represented as difference of two squares
- Modulo Operator (%) in C/C++ with Examples
- Count of subsets with sum equal to X using Recursion
- Program to calculate Electricity Bill
- Logarithm tricks for Competitive Programming
- Maximum number of unique values in the array after performing given operations
- Count of subarrays having exactly K perfect square numbers
- Sum of GCD of all possible sequences
- Find the numbers from 1 to N that contains exactly k non-zero digits
- Find the K closest points to origin using Priority Queue
- Longest sub-array with maximum GCD
- Minimize the maximum difference of adjacent elements after at most K insertions
- Minimum number of operations to convert array A to array B by adding an integer into a subarray
- Count of subarrays which start and end with the same element
- Puzzle | Dividing a Square into N smaller squares
- Expected Number of Trials to get N Consecutive Heads
- Maximum GCD of all subarrays of length at least 2
- Maximum profit by buying and selling a share at most K times | Greedy Approach
- Find K distinct positive odd integers with sum N
- Longest Mountain Subarray
- Digital Root of a given large integer using Recursion
- 0/1 Knapsack Problem to print all possible solutions
- Count number of pairs with positive sum in an array
- Check if a given number is a Perfect square using Binary Search
- Probability of getting K heads in N coin tosses

Area of a circle can simply be evaluated using following formula. Area = pi * r2 where r is radius of circle Recommended: Please solve… Read More »

Finding area using given sides: Examples : Input : a = 5, b = 7, c = 8 Output : Area of a triangle is… Read More »

Factorial of a non-negative integer, is multiplication of all integers smaller than or equal to n. For example factorial of 6 is 6*5*4*3*2*1 which is… Read More »

LCM (Least Common Multiple) of two numbers is the smallest number which can be divided by both numbers. For example LCM of 15 and 20… Read More »

GCD (Greatest Common Divisor) or HCF (Highest Common Factor) of two numbers is the largest number that divides both of them. For example GCD of… Read More »

Given two matrices, the task to multiply them. Matrices can either be square or rectangular. Examples: Input : mat1[][] = {{1, 2}, {3, 4}} mat2[][]… Read More »

Given an integer n, write a function that returns count of trailing zeroes in n!. Examples : Input: n = 5 Output: 1 Factorial of… Read More »

Catalan numbers are a sequence of natural numbers that occurs in many interesting counting problems like following. 1) Count the number of expressions containing n… Read More »

Before the advent of QWERTY keyboards, texts and numbers were placed on the same key. For example, 2 has “ABC” if we wanted to write… Read More »

Online Coding Round: Find if a given string contains duplicates Given a BST, find the maximum N elements of the tree Given a BST, convert… Read More »

Given an array arr[] of size n where every element is in range from 0 to n-1. Rearrange the given array so that arr[i] becomes… Read More »

Given two rectangles, find if the given two rectangles overlap or not. Note that a rectangle can be represented by two coordinates, top left and… Read More »

Given two numbers, write a C program to swap the given numbers. Input : x = 10, y = 20; Output : x = 20,… Read More »

Given two variables, x and y, swap two variables without using a third variable. Method 1 (Using Arithmetic Operators) The idea is to get sum… Read More »

Given an array of integers, find sum of its elements. Examples : Input : arr[] = {1, 2, 3} Output : 6 1 + 2… Read More »