## Calculate nCr using Pascal’s Triangle

A useful application of Pascal’s triangle is the calculation of combinations. The formula to find nCr is n! / r! * (n – r)! which… Read More »

- How can one become good at Data structures and Algorithms easily?
- Find maximum in a stack in O(1) time and O(1) extra space
- Cracking Technical Interviews
- Print the nodes of binary tree as they become the leaf node
- Reach the numbers by making jumps of two given lengths
- Lower and Upper Bound Theory
- Shannon-Fano Algorithm for Data Compression
- Rearrange Odd and Even values in Alternate Fashion in Ascending Order
- Dijkstra's shortest path with minimum edges
- Sort the array of strings according to alphabetical order defined by another string
- Sum of similarities of string with all of its suffixes
- How to write a Pseudo Code?
- Check if it is possible to reach a number by making jumps of two given length
- Code Optimization Technique (logical AND and logical OR)
- Dividing a Large file into Separate Modules in C/C++, Java and Python
- Find the number in a range having maximum product of the digits
- Smallest power of 2 which is greater than or equal to sum of array elements
- Iterative Letter Combinations of a Phone Number
- Ternary Search
- Program to print the Zigzag pattern
- Merge K sorted arrays | Set 3 ( Using Divide and Conquer Approach )
- Largest perfect square number in an Array
- Length of the longest alternating subarray
- Smallest Pair Sum in an array
- Number of array elements derivable from D after performing certain operations
- Count distinct substrings that contain some characters at most k times
- Color N boxes using M colors such that K boxes have different color from the box on its left
- Jump Pointer Algorithm
- Choose atleast two elements from array such that their GCD is 1 and cost is minimum
- Find alphabet in a Matrix which has maximum number of stars around it

A useful application of Pascal’s triangle is the calculation of combinations. The formula to find nCr is n! / r! * (n – r)! which… Read More »

Given an integer N, the task is to count all possible N digit numbers such that A + reverse(A) = 10N – 1 where A… Read More »

Given an array arr[] and an integer k, we can cut this array at k different positions where k[] stores the positions of all the… Read More »

Given an N x N matrix and two integers S and K, the task is to find whether there exists a K x K sub-matrix… Read More »

Given N points in 2 dimensional plane. A point is said to be above another point if the X coordinates of both points are same… Read More »

Given an array a[] consisting only 0 and 1. The task is to check if it is possible to transform the array such that the… Read More »

Given a set, write a Python program to generate all possible subset of size n of given set within a list. Examples: Input : {1,… Read More »

Given an array arr[], the task is to find the sum of the minimum elements of every possible sub-array of the array. Examples: Input: arr[]… Read More »

Given an array arr[], the task is to find the sum of the maximum elements of every possible sub-array of the array. Examples: Input: arr[]… Read More »

Given a rectangle of height H and width W which has the bottom left corner at (0, 0). The task is to count the number… Read More »

Given an integer N, the task is to construct a tree such that sum of for all ordered pairs (u, v) is maximum where u… Read More »

Given the position of a Bishop on an 8 * 8 chessboard, the task is to count the total number of squares that can be… Read More »

Given a string str, the task is to print all the distinct permutations of str. A permutation is an arrangement of all or part of… Read More »

Given the number of ‘X’ and ‘Y’ in a string which consists of characters from the set {‘X’, ‘Y’}, the task is to find the… Read More »

Given a grid of size (NxM) is to be filled with integers. Filling of cells in the grid should be done in the following manner:… Read More »