- Find all the numbers in a string using regular expression in Python
- Check if the sum of perfect squares in an array is divisible by x
- Find the nth term of the series 0, 8, 64, 216, 512, . . .
- Sum of elements whose square root is present in the array
- Leftmost and rightmost indices of the maximum and the minimum element of an array
- Sum of elements from an array having even parity
- Count numbers have all 1s together in binary representation
- The most occurring number in a string using Regex in python
- All pairs whose xor gives unique prime
- Count of numbers which can be made power of 2 by given operation
- Find elements of array using XOR of consecutive elements
- Find the Nth term of the series 9, 45, 243,1377
- Pairs from an array that satisfy the given condition
- Find the sum of first N terms of the series 2*3*5, 3*5*7, 4*7*9, ...
- Jump in rank of a student after updating marks
- Program to find the nth term of the series -2, 4, -6, 8....
- Program to find the Nth term of the series 0, 3/1, 8/3, 15/5........
- Find the sum of non-prime elements in the given array
- Print all safe primes below N
- Count pairs in an array such that at least one element is prime
- Check whether the sum of absolute difference of adjacent digits is Prime or not
- Print prime numbers with prime sum of digits in an array
- Print all multiplicative primes <= N
- Find the node whose xor with x gives minimum value
- Find the node whose xor with x gives maximum value
- Find the node whose sum with X has maximum set bits
- Find the node whose absolute difference with X gives maximum value
- Find the node whose sum with X has minimum set bits
- Find the node whose absolute difference with X gives minimum value
- Count the nodes whose weight is a perfect square
- Count the nodes in the given tree whose weight is prime
- Count the nodes in the given tree whose weight is even
- Find the root of the sub-tree whose weighted sum is minimum
- Find the root of the sub-tree whose weighted sum XOR with X is minimum
- Find the root of the sub-tree whose weighted sum XOR with X is maximum
- Count the nodes in the given tree whose weight is a power of two
- Count the nodes in the given tree whose weight is even parity
- Count the nodes in the given tree whose sum of digits of weight is odd
- Count the nodes of the given tree whose weighted string is a palindrome
- Count the nodes of the given tree whose weight has X as a factor
- Count the nodes of a tree whose weighted string does not contain any duplicate characters
- Count the nodes of a tree whose weighted string is an anagram of the given string
- Count the nodes of the tree which make a pangram when concatenated with the sub-tree nodes
- Python | Count the array elements with factors less than or equal to the factors of given x
- How to swap two numbers without using a temporary variable?
- Efficient way to multiply with 7
- Find the Number Occurring Odd Number of Times
- Find the Missing Number
- Two elements whose sum is closest to zero
- Find whether a given number is a power of 4 or not
- A Product Array Puzzle
- Check if array elements are consecutive | Added Method 3
- Smallest of three integers without comparison operators
- Count total set bits in all numbers from 1 to n
- Partition problem | DP-18
- Find the element that appears once
- Generate n-bit Gray Codes
- Minimum insertions to form a palindrome | DP-28
- Print all possible strings of length k that can be formed from a set of n characters
- Print all possible paths from top left to bottom right of a mXn matrix
- Count all possible paths from top left to bottom right of a mXn matrix
- Find the first repeating element in an array of integers
- K'th Smallest/Largest Element in Unsorted Array | Set 2 (Expected Linear Time)
- Given a matrix of 'O' and 'X', find the largest subsquare surrounded by 'X'
- Find the element that appears once in an array where every other element appears twice
- Find the nearest smaller numbers on left side in an array
- Sum of minimum and maximum elements of all subarrays of size k.
- Count numbers from 1 to n that have 4 as a digit
- Count distinct elements in every window of size k
- Trapping Rain Water
- Minimum Initial Points to Reach Destination
- Count of n digit numbers whose sum of digits equals to given sum
- Given an array of pairs, find all symmetric pairs in it
- Print a pattern without using any loop
- Find XOR of two number without using XOR operator
- Print individual digits as words without using if or switch
- Fibonacci Coding
- Count Fibonacci numbers in given range in O(Log n) time and O(1) space
- Longest Zig-Zag Subsequence
- Common elements in all rows of a given matrix
- Repeated subsequence of length 2 or more
- Count pairs formed by distinct element sub-arrays
- Find smallest range containing elements from k lists
- Find the minimum difference between Shifted tables of two numbers
- Longest Common Increasing Subsequence (LCS + LIS)
- Remove duplicates from an array of small primes
- Rearrange positive and negative numbers with constant extra space
- Printing Maximum Sum Increasing Subsequence
- Print all n-digit strictly increasing numbers
- Calculate sum of all numbers present in a string
- Find Shortest distance from a guard in a Bank
- Count digit groupings of a number with given constraints
- Count Distinct Subsequences
- Frequency Measuring Techniques for Competitive Programming
- Length of Longest sub-string that can be removed
- Count all sorted rows in a matrix
- Count all pairs with given XOR
- Print matrix in diagonal pattern
- Minimum sum of two numbers formed from digits of an array
- Convert to a string that is repetition of a substring of k length
- Maximum 0's between two immediate 1's in binary representation
- Minimum sum subsequence such that at least one of every four consecutive elements is picked
- Find all distinct subset (or subsequence) sums of an array
- Sort even-placed elements in increasing and odd-placed in decreasing order
- Find sum of divisors of all the divisors of a natural number
- Print all possible consecutive numbers with sum N
- Find pair with greatest product in array
- Find pairs in array whose sums already exist in array
- Find elements which are present in first array and not in second
- k-th prime factor of a given number
- Queries on substring palindrome formation
- Count of index pairs with equal elements in an array
- Maximum number of groups of size 3 containing two type of items
- Minimum time required to produce m items
- Range Queries for Frequencies of array elements
- Check if reversing a sub array make the array sorted
- Allocate minimum number of pages
- Efficiently check if a string has all unique characters without using any additional data structure
- Largest subsequence having GCD greater than 1
- Nearest element with at-least one common prime factor
- Prime Factorization using Sieve O(log n) for multiple queries
- Maximum and Minimum in a square matrix.
- Count all pairs of an array which differ in K bits
- Ways to represent a number as a sum of 1's and 2's
- Find all pairs (a,b) and (c,d) in array which satisfy ab = cd
- Search, insert and delete in a sorted array
- Check if frequency of each digit is less than the digit
- Count pairs with sum as a prime number and less than n
- Noble integers in an array (count of greater elements is equal to value)
- Find if n can be written as product of k numbers
- Count the number of subarrays having a given XOR
- Minimum cost for acquiring all coins with k extra coins allowed with every coin
- Find the largest three elements in an array
- Check whether an array can be fit into another array rearranging the elements in the array
- Minimum number of Appends needed to make a string palindrome
- Find a peak element in a 2D array
- Count the number of ways to divide an array into three contiguous parts having equal sum
- k-th distinct (or non-repeating) element in an array.
- Find index of an extra element present in one sorted array
- Print all distinct characters of a string in order (3 Methods)
- k-th smallest absolute difference of two elements in an array
- Print a given matrix in reverse spiral form
- Print modified array after multiple array range increment operations
- Random list of M non-negative integers whose sum is N
- Program to print all substrings of a given string
- Count of only repeated element in a sorted array of consecutive elements
- Count subarrays having total distinct elements same as original array
- Find all pairs (a, b) in an array such that a % b = k
- Extract maximum numeric value from a given string | Set 1 (General approach)
- Elements of an array that are not divisible by any element of another array
- Divide the two given numbers by their common divisors
- Check whether the sum of absolute difference of adjacent digits is Prime or not
- Minimum insertions to form a palindrome with permutations allowed
- Nth Even length Palindrome
- Program to calculate the number of odd days in given number of years
- Find the character in first string that is present at minimum index in second string
- Find the overlapping sum of two arrays
- Program to print solid and hollow square patterns
- Count of integers of length N and value less than K such that they contain digits only from the given set
- Convert all substrings of length 'k' from base 'b' to decimal
- Check if the given string of words can be formed from words present in the dictionary
- Check if binary representation of a given number and its complement are anagram
- Next greater element in same order as input
- Longest common substring in binary representation of two numbers
- Remove minimum number of elements such that no common element exist in both array
- Evaluate a boolean expression represented as string
- Count subarrays with equal number of occurrences of two given elements
- Count of sub-sequences which satisfy the given condition
- Count number of paths whose weight is exactly X and has at-least one edge of weight M
- Count number of distinct pairs whose sum exists in the given array
- Maximum sum bitonic subarray
- Check if a number is power of 8 or not
- C++ Program for Longest Increasing Subsequence
- Check if two unsorted arrays (with duplicates allowed) have same elements
- Positive elements at even and negative at odd positions (Relative order not maintained)
- Find substrings that contain all vowels
- Program to find if a character is vowel or Consonant
- Array range queries over range queries
- Smallest number k such that the product of digits of k is equal to n
- Generate two output strings depending upon occurrence of character in input string.
- Given a n-ary tree, count number of nodes which have more number of children than parents
- Program for diamond pattern with different layers
- Find the Majority Element | Set 3 (Bit Magic)
- Number of triangles that can be formed
- Number of subarrays having absolute sum greater than K | Set-2
- Mean of range in array
- Distance of closest zero to every element
- Combinations from n arrays picking one element from each array
- Tile Stacking Problem
- Cumulative frequency of count of each element in an unsorted array
- Print digit's position to be removed to make a number divisible by 6
- Maximum number of characters between any two same character in a string
- Longest subsequence such that difference between adjacents is one | Set 2
- Queries for the product of first N factorials
- Print symmetric double triangle pattern
- Elements to be added so that all elements of a range are present in array
- Only integer with positive value in positive negative value in array
- Divisors of n-square that are not divisors of n
- Largest number with prime digits
- Maximum Unique Element in every subarray of size K
- Check whether a number can be represented by sum of two squares
- Find if there is a rectangle in binary matrix with corners as 1
- Pair with given sum and maximum shortest distance from end
- Generate original array from an array that store the counts of greater elements on right
- Find minimum shift for longest common prefix
- Minimum jumps to reach last building in a matrix
- Program to find the minimum (or maximum) element of an array
- Find largest element from array without using conditional operator
- Program to print number with star pattern
- Program to find third side of triangle using law of cosines
- Check whether second string can be formed from characters of first string
- Partition into two subarrays of lengths k and (N - k) such that the difference of sums is maximum
- Largest subset with sum of every pair as prime
- Minimum number of points to be removed to get remaining points on one side of axis
- Count number of increasing subsequences of size k
- Smallest subarray with all occurrences of a most frequent element
- Count subarrays with equal number of 1's and 0's
- Maximum possible elements which are divisible by 2
- Check if the given string is the same as its reflection in a mirror
- Number of terms in Geometric Series with given conditions
- Program to print V and inverted-V pattern
- Find the position of the last removed element from the array
- Count maximum-length palindromes in a String
- Construct sum-array with sum of elements in given range
- Longest Uncommon Subsequence
- Space efficient iterative method to Fibonacci number
- Program to copy the contents of one array into another in the reverse order
- Count of numbers appearing in the given ranges at-least K times
- Find minimum length sub-array which has given sub-sequence in it
- Maximum sum of increasing order elements from n arrays
- Find i'th Index character in a binary string obtained after n iterations
- Most frequent element in an array
- Least frequent element in an array
- Find the only repetitive element between 1 to n-1
- Largest even digit number not greater than N
- Find largest d in array such that a + b + c = d
- Sum of special triplets having elements from 3 arrays
- Array range queries for elements with frequency same as value
- Count substrings with each character occurring at most k times
- Maximum possible difference of two subsets of an array
- XOR of a subarray (range of elements)
- Count pairs in an array which have at least one digit common
- Find the Largest Cube formed by Deleting minimum Digits from a number
- Longest substring having K distinct vowels
- Print array elements that are divisible by at-least one other
- Minimum number using set bits of a given number
- Program to print the hollow numerical parallelogram
- Printing longest Increasing consecutive subsequence
- Count binary strings with twice zeros in first half
- Max sum of M non-overlapping subarrays of size K
- Find Sum of all unique sub-array sum for a given array.
- Prefixes with more a than b
- Find the value of N XOR'ed to itself K times
- Find the only element that appears b times
- Print all triplets with given sum
- Compute power of power k times % m
- Count elements present in first array but not in second
- Minimum steps to reach end from start by performing multiplication and mod operations with array elements
- Maximum number by concatenating every element in a rotation of an array
- Minimum operations required to make all the elements distinct in an array
- Previous greater element
- Count of elements of an array present in every row of NxM matrix
- Number of Counterclockwise shifts to make a string palindrome
- First non-repeating character using one traversal of string | Set 2
- Find the Nth Mosaic number
- Longest Common Subsequence | DP using Memoization
- Egg Dropping Puzzle with 2 Eggs and K Floors
- Elements of first array that have more frequencies
- Sum of similarities of string with all of its suffixes
- Smallest sum contiguous subarray | Set-2
- Maximum bishops that can be placed on N*N chessboard
- All elements in an array are Same or not?
- Program to print Sine-Wave Pattern
- Sum of all elements repeating 'k' times in an array
- Check if a number is in given base or not
- Find next palindrome prime
- Counting frequencies of array elements
- Maximum profit after buying and selling the stocks
- Find N in the given matrix that follows a pattern
- Find the Missing Number in a sorted array
- Elements that occurred only once in the array
- Check if the first and last digit of the smallest number forms a prime
- Length of longest common subsequence containing vowels
- Minimum number of items to be delivered
- Longest subarray having maximum sum
- Find the largest after deleting the given elements
- Solve the Logical Expression given by string
- Find the Initial Array from given array after range sum queries
- Longest dividing subsequence
- Maximize the product of four factors of a Number
- Find minimum number of Log value needed to calculate Log upto N
- Longest Subarray with Sum greater than Equal to Zero
- Longest subarray having difference in the count of 1's and 0's equal to k
- Minimum number greater than the maximum of array which cannot be formed using the numbers in the array
- Minimum changes required to make two arrays identical
- Count common subsequence in two strings
- Minimum and Maximum prime numbers in an array
- Program to print Kite Pattern
- Minimum odd cost path in a matrix
- Divide an array into K subarray with the given condition
- Maximize the value of A by replacing some of its digits with digits of B
- Find triplets in an array whose AND is maximum
- Find column with maximum sum in a Matrix
- Program to print the Zigzag pattern
- Find the k-th smallest divisor of a natural number N
- Pair with maximum difference in a Matrix
- Check if a pair with given absolute difference exists in a Matrix
- Find the sum of all highest occurring elements in an Array
- Sum of all minimum occurring elements in an Array
- Program to print Hut Star pattern
- Product of non-repeating (distinct) elements in an Array
- Sum of all prime numbers in an Array
- Product of all prime numbers in an Array
- Program to Print Mirrored Hollow Parallelogram
- Maximum number of Unique integers in Sub-Array of given size
- Find the smallest after deleting given elements
- Remove duplicates from unsorted array using Map data structure
- Find the k largest numbers after deleting the given elements
- Find the k smallest numbers after deleting given elements
- Number of leading zeros in binary representation of a given number
- Check if a number is a Mystery Number
- Find the Product of first N Prime Numbers
- Find subsequences with maximum Bitwise AND and Bitwise OR
- Count and Sum of composite elements in an array
- Count elements such that there are exactly X elements with values greater than or equal to X
- Find maximum distance between any city and station
- Program to find Prime Numbers Between given Interval
- Product of all the Composite Numbers in an array
- Convert given array to Arithmetic Progression by adding an element
- Count pairs in an array such that frequency of one is at least value of other
- Replace each element by the difference of the total size of the array and frequency of that element
- Sum of array Elements without using loops and recursion
- Magical Pattern
- Count pairs in an array such that both elements has equal set bits
- Largest number not greater than N all the digits of which are odd
- Find a number that divides maximum array elements
- Check if the array has an element which is equal to sum of all the remaining elements
- Check whether the frequencies of all the characters in a string are prime or not
- Count pairs from two arrays whose modulo operation yields K
- Find all numbers that divide maximum array elements
- Sort an array according to the increasing count of distinct Prime Factors
- Count Triplets such that one of the numbers can be written as sum of the other two
- Number of leaf nodes in the subtree of every node of an n-ary tree
- Number of ways to reach the end of matrix with non-zero AND value
- Minimize the number of steps required to reach the end of the array
- Maximum sum subarray such that start and end values are same
- Find maximum element of each column in a matrix
- Maximum length substring with highest frequency in a string
- Sum of elements in an array having prime frequency
- Find smallest and largest element from square matrix diagonals
- Find the sum of Eigen Values of the given N*N matrix
- Find the largest interval that contains exactly one of the given N integers.
- Find alphabet in a Matrix which has maximum number of stars around it
- Find a sub matrix with maximum XOR
- Minimum Distance Between Words of a String
- Count the number of special permutations
- Integers from the range that are composed of a single distinct digit
- Count numbers in a range having GCD of powers of prime factors equal to 1
- LCM of N numbers modulo M
- Minimum in an array which is first decreasing then increasing
- Minimum steps to reach any of the boundary edges of a matrix | Set 1
- Form N-copy string with add, remove and append operations
- Find minimum x such that (x % k) * (x / k) == n
- Sum of kth powers of first n natural numbers
- Find elements of array using XOR of consecutive elements
- Find the maximum possible value of the minimum value of modified array
- Area of Reuleaux Triangle
- Biggest Reuleaux Triangle within A Square
- Count pairs in an array that hold i+j= arr[i]+arr[j]
- Reach the numbers by making jumps of two given lengths
- Largest hexagon that can be inscribed within an equilateral triangle
- A Sum Array Puzzle
- Diagonal of a Regular Heptagon
- Diagonal of a Regular Decagon
- Length of Diagonal of a n-sided regular polygon
- Generate all rotations of a number
- Count number of pairs (i, j) such that arr[i] * arr[j] > arr[i] + arr[j]
- How to delete an element from the Set by passing its value in C++
- Minimum distance to the end of a grid from source
- Generate permutation of 1 to N such that absolute difference of consecutive numbers give K distinct integers
- Count rows in a matrix that consist of same element
- Number of subarrays have bitwise OR >= K
- Smallest multiple of 3 which consists of three given non-zero digits
- Minimum number of sets with numbers less than Y
- Minimum number N such that total set bits of all numbers from 1 to N is at-least X
- Count pairs of parentheses sequences such that parentheses are balanced
- Minimum steps required to convert X to Y where a binary matrix represents the possible conversions
- Distribute N candies among K people
- Program to find nth term of the series 1 4 15 24 45 60 92
- Possible cuts of a number such that maximum parts are divisible by 3
- First and Last Three Bits
- K length words that can be formed from given characters without repetition
- Program to print Step Pattern
- Length of the longest substring with consecutive characters
- Largest sub-set possible for an array satisfying the given condition
- Ways to paint N paintings such that adjacent paintings don't have same colors
- Maximum length subarray with LCM equal to product
- Find probability of selecting element from kth column after N iterations
- Find the sum of the all amicable numbers up to N
- Sum of P terms of an AP if Mth and Nth terms are given
- Ternary Search
- Biggest Reuleaux Triangle within a Square which is inscribed within a Circle
- Biggest Reuleaux Triangle within a Square which is inscribed within a Right angle Triangle
- Largest right circular cylinder that can be inscribed within a cone which is in turn inscribed within a cube
- Print all Proth primes up to N
- Find Pth term of a GP if Mth and Nth terms are given
- Count distinct elements in an array
- Count of strings that become equal to one of the two strings after one removal
- Minimum cost of choosing 3 increasing elements in an array of size N
- Rearrange Odd and Even values in Alternate Fashion in Ascending Order
- Count number of sub-sequences with GCD 1
- Largest number less than or equal to N/2 which is coprime to N
- Reverse Middle X Characters
- Find the area of largest circle inscribed in ellipse
- Print multiples of Unit Digit of Given Number
- Rectangle with minimum possible difference between the length and the width
- Count strings that end with the given pattern
- Biggest Reuleaux Triangle inscribed within a Square inscribed in an equilateral triangle
- Biggest Reuleaux Triangle inscirbed within a square inscribed in a semicircle
- Count of values of x <= n for which (n XOR x) = (n - x)
- Generate lexicographically smallest string of 0, 1 and 2 with adjacent swaps allowed
- Find the final X and Y when they are Altering under given condition
- Check if it is possible to reach a number by making jumps of two given length
- Count the number of survivors
- Remove characters from a numeric string such that string becomes divisible by 8
- Remove any corner X rows and columns from a matrix
- Count of pairs of (i, j) such that ((n % i) % j) % n is maximized
- Largest sphere that can be inscribed in a right circular cylinder inscribed in a frustum
- Minimum positive integer divisible by C and is not in range [A, B]
- Count all Prime Length Palindromic Substrings
- Find minimum difference between any two elements | Set 2
- Find Intersection of all Intervals
- Maximum length subsequence such that adjacent elements in the subsequence have a common factor
- Number of strings that satisfy the given condition
- Check if a string can be converted to another string by replacing vowels and consonants
- Sum of XOR of all subarrays
- Sum of bitwise AND of all subarrays
- Minimum index i such that all the elements from index i to given index are equal
- Find the longest Fibonacci-like subarray of the given array
- Split an array into groups of 3 such that X3 is divisible by X2 and X2 is divisible by X1
- Queries for number of distinct integers in Suffix
- Maximum positive integer divisible by C and is in the range [A, B]
- Ways to form an array having integers in given range such that total sum is divisible by 2
- Select numbers in such way to maximize the amount of money
- Check whether the number can be made perfect square after adding 1
- Number of Hamiltonian cycle
- Split the array into odd number of segments of odd lengths
- Check if an array of 1s and 2s can be divided into 2 parts with equal sum
- Minimum number of stacks possible using boxes of given capacities
- Count array elements that divide the sum of all other elements
- Number of trailing zeroes in base 16 representation of N!
- Count paths with distance equal to Manhattan distance
- Find the number of solutions to the given equation
- Find whether only two parallel lines contain all coordinates points or not
- XOR of a submatrix queries
- Find the number of distinct pairs of vertices which have a distance of exactly k in a tree
- Find the minimum number of preprocess moves required to make two strings equal
- Find the Nth term of the series where each term f[i] = f[i - 1] - f[i - 2]
- Minimum number of given powers of 2 required to represent a number
- Sum of minimum element of all sub-sequences of a sorted array
- k-th missing element in an unsorted array
- Maximum occurrence of prefix in the Array
- Longest subsequence such that adjacent elements have at least one common digit
- Count all elements in the array which appears at least K times after their first occurrence
- Two equal sum segment range queries
- Numbers in a Range with given Digital Root
- Sum of numbers from 1 to N which are in Lucas Sequence
- Check for an array element that is co-prime with all others
- Find GCD of factorial of elements of given array
- Minimum steps to make all the elements of the array divisible by 4
- Find sum of a[i]%a[j] for all valid pairs
- Sum of elements in an array whose difference with the mean of another array is less than k
- Count of numbers from range [L, R] whose sum of digits is Y
- Find the sum of all Truncatable primes below N
- Search an element in given N ranges
- Check if the given array can be reduced to zeros with the given operation performed given number of times
- Find the numbers of strings that can be formed after processing Q queries
- Count number of trailing zeros in Binary representation of a number using Bitset
- Minimum array elements to be changed to make Recaman's sequence
- Maximum array sum that can be obtained after exactly k changes
- Replace the odd positioned elements with their cubes and even positioned elements with their squares
- Pairs of strings which on concatenating contains each character of "string"
- Generate original array from difference between every two consecutive elements
- Count number of ways to reach a given score in a Matrix
- Count of sub-strings that do not contain all the characters from the set {'a', 'b', 'c'} at the same time
- Find the area of the shaded region formed by the intersection of four semicircles in a square
- Maximum points covered after removing an Interval
- Minimum steps to color the tree with given colors
- Check whether factorial of N is divisible by sum of first N natural numbers
- Count of distinct sums that can be obtained by adding prime numbers from given arrays
- Maximum element in a sorted and rotated array
- Find the minimum number of steps to reach M from N
- Count the number of operations required to reduce the given number
- Sum of the series Kn + ( K(n-1) * (K-1)1 ) + ( K(n-2) * (K-1)2 ) + ....... (K-1)n
- Find the value of N when F(N) = f(a)+f(b) where a+b is the minimum possible and a*b = N
- Area of the biggest ellipse inscribed within a rectangle
- Count distinct points visited on the number line
- Count consecutive pairs of same elements
- Length of the longest increasing subsequence such that no two adjacent elements are coprime
- Find n positive integers that satisfy the given equations
- Find the Kth node in the DFS traversal of a given subtree in a Tree
- Maximize the happiness of the groups on the Trip
- Find (1^n + 2^n + 3^n + 4^n) mod 5 | Set 2
- Find the longest sub-string which is prefix, suffix and also present inside the string
- Find missing element in a sorted array of consecutive numbers
- Minimum number of changes such that elements are first Negative and then Positive
- Find the number of players who roll the dice when the dice output sequence is given
- Predict the winner of the game on the basis of absolute difference of sum by selecting numbers
- Program to calculate product of digits of a number
- Count the number of currency notes needed
- Minimize the sum calculated by repeatedly removing any two elements and inserting their sum to the Array
- Queries to answer the number of ones and zero to the left of given index
- Program to find the maximum difference between the index of any two different numbers
- Minimum possible final health of the last monster in a game
- Check if all the 1's in a binary string are equidistant or not
- Find the sum of digits of a number at even and odd places
- Find the value at kth position in the generated array
- Count the number of sub-arrays such that the average of elements present in the sub-array is greater than that not present in the sub-array
- Find the lexicographically smallest string which satisfies the given condition
- Find the number of sub arrays in the permutation of first N natural numbers such that their median is M
- Travelling Salesman Problem implementation using BackTracking
- Find HCF of two numbers without using recursion or Euclidean algorithm
- Queries to check if substring[L...R] is palindrome or not
- Count pairs of non-overlapping palindromic sub-strings of the given string
- Number of triangles possible with given lengths of sticks which are powers of 2
- Count of elements whose absolute difference with the sum of all the other elements is greater than k
- Find minimum positive integer x such that a(x^2) + b(x) + c >= k
- Print 2-D co-ordinate points in ascending order followed by their frequencies
- Number of subsequences with zero sum
- Count of sub-strings that do not consist of the given character
- Count the pairs of vowels in the given string
- Find the kth element in the series generated by the given N ranges
- Check whether the given string is a valid identifier
- Count of sub-strings of length n possible from the given string
- Maximum absolute difference in an array
- Move all zeros to start and ones to end in an Array of random integers
- Find out the minimum number of coins required to pay total amount
- Maximum elements which can be crossed using given units of a and b
- Sum of the series 1, 2, 4, 3, 5, 7, 9, 6, 8, 10, 11, 13.. till N-th term
- Reverse alternate k characters in a string
- Check if a number from every row can be selected such that xor of the numbers is greater than zero
- Area of triangle formed by the axes of co-ordinates and a given straight line
- Check if given two straight lines are identical or not
- Minimum number of elements to be removed such that the sum of the remaining elements is equal to k
- Find maximum product of digits among numbers less than or equal to N
- Check if the frequency of any character is more than half the length of the string
- Maximum length palindrome that can be created with characters in range L and R
- Number of ways to arrange K different objects taking N objects at a time
- Game Theory in Balanced Ternary Numeral System | (Moving 3k steps at a time)
- Find the position of box which occupies the given ball
- Find the Diameter or Longest chord of a Circle
- Determine the position of the third person on regular N sided polygon
- Length of the chord of the circle whose radius and the angle subtended at the center by the chord is given
- Maximum length of subarray such that sum of the subarray is even
- Sliding Window Maximum (Maximum of all subarrays of size k) using stack in O(n) time
- Longest alternative parity subsequence
- Roots of the quadratic equation when a + b + c = 0 without using Shridharacharya formula
- Generate an array of size K which satisfies the given conditions
- Rearrange the array to maximize the number of primes in prefix sum of the array
- Find the occurrence of the given binary pattern in the binary representation of the array elements
- Bitwise AND of sub-array closest to K
- Optimal Strategy for a Game | Set 2
- Sum of GCDs of each row of the given matrix
- Queries to find the maximum Xor value between X and the nodes of a given level of a perfect binary tree
- Find the index which is the last to be reduced to zero after performing a given operation
- Number of common tangents between two circles if their centers and radius is given
- Check if a circle lies inside another circle or not
- Build original array from the given sub-sequences
- Print all leaf nodes of an n-ary tree using DFS
- Count the nodes of the tree whose weighted string contains a vowel
- Find the permutation p from the array q such that q[i] = p[i+1] - p[i]
- Print all neighbour nodes within distance K
- Longest substring such that no three consecutive characters are same
- Number of ways to arrange a word such that no vowels occur together
- Minimum count of elements that sums to a given number
- Maximum items that can be filled in K Knapsacks of given Capacity
- Sum of all perfect numbers present in an array
- Print all the sub diagonal elements of the given square matrix
- Print all the super diagonal elements of the given square matrix
- Find the number of p-sided squares in a grid with K blacks painted
- Construct the Rooted tree by using start and finish time of its DFS traversal
- Find the total number of composite factor for a given number
- Count of substrings which contains a given character K times
- Total number of odd length palindrome sub-sequence around each centre
- Print Lower Hessenberg matrix of order N
- Print Upper Hessenberg matrix of order N
- Count common elements in two arrays containing multiples of N and M
- Total number of possible Binary Search Trees using Catalan Number
- Minimum operations to make sum of neighbouring elements <= X
- Number of triangles formed by joining vertices of n-sided polygon with one side common
- Maximum number of region in which N non-parallel lines can divide a plane
- Count pairs of strings that satisfy the given conditions
- Find the maximum number of elements divisible by 3
- Rearrange characters in a string such that no two adjacent are same using hashing
- Number of triangles formed by joining vertices of n-sided polygon with two common sides and no common sides
- Find Nth smallest number that is divisible by 100 exactly K times
- Find maximum value of the last element after reducing the array with given operations
- Find optimal weights which can be used to weigh all the weights in the range [1, X]
- Case-specific Sorting of Strings
- Number of ways of writing N as a sum of 4 squares
- Find a sequence of N prime numbers whose sum is a composite number
- Number of possible permutations when absolute difference between number of elements to the right and left are given
- Find the Nth term divisible by a or b or c
- Find K vertices in the graph which are connected to at least one of remaining vertices
- Reverse individual words with O(1) extra space
- Count of numbers whose 0th and Nth bits are set
- Percentage increase in the cylinder if the height is increased by given percentage but radius remains constant
- Percentage increase in volume of the sphere if radius is increased by a given percentage
- Find a number containing N - 1 set bits at even positions from the right
- Sentence Case of a given Camel cased string
- Minimum steps required to convert the matrix into lower hessenberg matrix
- Find a subarray whose sum is divisible by size of the array
- Optimally accommodate 0s and 1s from a Binary String into K buckets
- Flip minimum signs of array elements to get minimum sum of positive elements possible
- Find the number which when added to the given ratio a : b, the ratio changes to c : d
- Longest Consecuetive Subsequence when only one insert operation is allowed
- Sum of Semi-Prime Numbers less than or equal to N
- Find three element from given three arrays such that their sum is X | Set 2
- Number of intersections between two ranges
- Maximum element in an array such that its previous and next element product is maximum
- Number of ways of distributing N identical objects in R distinct groups
- Number of ways of distributing N identical objects in R distinct groups with no groups empty
- Total ways of choosing X men and Y women from a total of M men and W women
- Sort an array without changing position of negative numbers
- Greatest contiguous sub-array of size K
- Find Leftmost and Rightmost node of BST from its given preorder traversal
- Minimum number of steps to convert a given matrix into Diagonally Dominant Matrix
- Longest sub-array with equal number of alphabets and numeric characters
- Distinct adjacent elements in a binary array
- Find a partition point in array to maximize its xor sum
- 21 Matchsticks Problem
- Length of longest subarray in which elements greater than K are more than elements not greater than K
- Count of strings in the first array which are smaller than every string in the second array
- Number of N length sequences whose product is M
- Remove an element to maximize the GCD of the given array
- Number of hours after which the second person moves ahead of the first person if they travel at a given speed
- Number formed by the rightmost set bit in N
- Count of pairs between two arrays such that the sums are distinct
- Sequence with sum K and minimum sum of absolute differences between consecutive elements
- Find minimum possible values of A, B and C when two of the (A + B), (A + C) and (B + C) are given
- Find the color of given node in an infinite binary tree
- Arrange N elements in circular fashion such that all elements are strictly less than sum of adjacent elements
- Check if all the elements can be made equal on dividing with X and Y
- Count of N digit numbers possible which satisfy the given conditions
- Distinct strings such that they contains given strings as sub-sequences
- Count pairs with given sum | Set 2
- Probability of distributing M items among X bags such that first bag contains N items
- Minimum operations required to convert X to Y by multiplying X with the given co-primes
- Partition the array in K segments such that bitwise AND of individual segment sum is maximized
- Count ways to divide circle using N non-intersecting chord | Set-2
- Find k ordered pairs in array with minimum difference d
- Largest and smallest digit of a number
- Maximum length sub-array which satisfies the given conditions
- Minimum number of Bottles visible when a bottle can be enclosed inside another Bottle
- Sum of the distances from every node to all other nodes is maximum
- Perimeter of an Ellipse
- Find the number of occurrences of a character upto preceding position
- Longest sub string of 0's in a binary string which is repeated K times
- XOR in a range of a binary array
- Swap all occurrences of two characters to get lexicographically smallest string
- Count of elements that can be deleted without disturbing the mean of the initial array
- Maximum sum of the array after dividing it into three segments
- Find prime numbers in the first half and second half of an array
- Smallest element greater than X not present in the array
- Check if the given string is vowel prime
- Euler zigzag numbers ( Alternating Permutation )
- Program for sum of cosh(x) series upto Nth term
- Alcuin's Sequence
- Wedderburn–Etherington number
- Find the kth smallest number with sum of digits as m
- Rearrange the characters of the string such that no two adjacent characters are consecutive English alphabets
- Count number of ways to reach destination in a maze
- Ramanujan Prime
- Quadruplet pair with XOR zero in the given Array
- Program to find first N Fermat Numbers
- Recursive program to find all Indices of a Number
- Right most non-zero digit in multiplication of array elements
- Maximum number of given operations to remove the entire string
- Count of all possible pairs of disjoint subsets of integers from 1 to N
- Print all the peaks and troughs in an Array of Integers
- Queries to print the character that occurs the maximum number of times in a given range
- Subsequence X of length K such that gcd(X[0], X[1]) + (X[2], X[3]) + ... is maximized
- Maximum Bitwise AND value of subsequence of length K
- Sum of N terms in the expansion of Arcsin(x)
- Product of Primes of all Subsets
- Largest substring with same Characters
- Maximum value of division of two numbers in an Array
- Nambiar Number Generator
- Sum of prime numbers without odd prime digits
- Maximum number of elements without overlapping in a Line
- Find the sum of elements of the Matrix generated by the given rules
- Sum of the sums of all possible subsets
- Concentric Hexagonal Numbers
- Find the diagonal of the Cube
- Nearest greater number by interchanging the digits
- Find the maximum cost path from the bottom-left corner to the top-right corner
- Check whether two points (x1, y1) and (x2, y2) lie on same side of a given line or not
- Check if the first and last digit of number N is prime and their sum is less than K
- Minimize the cost of buying the Objects
- Sum of digits with even number of 1's in their binary representation
- Count number of ways to reach destination in a Maze using BFS
- Remove duplicates from unsorted array using Set data structure
- Minimum operations required to convert a binary string to all 0s or all 1s
- Find the smallest positive number which can not be represented by given digits
- Program to duplicate Vowels in String
- Find the remainder when First digit of a number is divided by its Last digit
- Find the remaining balance after the transaction
- Print the path between any two nodes of a tree | DFS
- Count the number of occurrences of a particular digit in a number
- Percentage increase in the volume of cuboid if length, breadth and height are increased by fixed percentages
- Count number of ways to get Odd Sum
- Convert an unbalanced bracket sequence to a balanced sequence
- Maximum String Partition
- Count of integers that divide all the elements of the given array
- Count number of bits to be flipped to convert A to B | Set-2
- Minimum number of Fibonacci jumps to reach end
- Print all the permutation of length L using the elements of an array | Iterative
- Reversing a Queue using another Queue
- Check which player visits more number of Nodes
- Reverse every word of the string except the first and the last character
- Find F(n) when F(i) and F(j) of a sequence are given
- First N terms whose sum of digits is a multiple of 10
- Sand Timer Flip Counting Problem
- Count of triplets that satisfy the given equation
- Lexicographically smallest string of length N and sum K
- Minimum increment operations to make K elements equal
- Minimum deletions required to make frequency of each letter unique
- Count number of substrings of a string consisting of same characters
- Check if the bracket sequence can be balanced with at most one change in the position of a bracket
- Repeated sum of first N natural numbers
- Product of elements in an array having prime frequency
- Number of sub arrays with negative product
- Find the XOR of first N Prime Numbers
- Find the farthest smaller number in the right side
- Check if the array has an element which is equal to XOR of remaining elements
- Replace elements with absolute difference of smallest element on left and largest element on right
- Find the number of pairs such that their gcd is equals to 1
- Find number of subarrays with XOR value a power of 2
- Summation of floor of harmonic progression
- Find the sum of all possible pairs in an array of N elements
- Find subarray with given sum with negatives allowed in constant space
- Count of numbers in the range [L, R] which satisfy the given conditions
- Maximum perimeter of a square in a 2D grid
- Check if array contains contiguous integers with duplicates allowed
- Find the character made by adding all the characters of the given string
- Count of triples (A, B, C) where A*C is greater than B*B
- Count of distinct remainders when N is divided by all the numbers from the range [1, N]
- Count the number of subsequences of length k having equal LCM and HCF
- Count of subsets not containing adjacent elements
- Check if the rows of a binary matrix can be made unique by removing a single column
- Check if a right-angled triangle can be formed by moving any one of the coordinates
- Minimum cost to make all array elements equal
- Bitwise AND of the sum of prime numbers and the sum of composite numbers in an array
- Queries to check whether all the elements in the given range occurs even number of times
- Sum of squares of all Subsets of given Array
- Prime Subset Product Problem
- Program to find the number from given holes
- Find the minimum number of moves to reach end of the array
- Absolute difference between the XOR of Non-Prime numbers and Prime numbers of an Array
- Find third number such that sum of all three number becomes prime
- Angle between 3 given vertices in a n-sided regular polygon
- Count of elements which are equal to the XOR of the next two elements
- Number of occurrences of a given angle formed using 3 vertices of a n-sided regular polygon
- Minimum characters that are to be inserted such that no three consecutive characters are same
- Check if the Matrix satisfies the given conditions
- Count all substrings having character K
- Find all even length binary sequences with same sum of first and second half bits | Iterative
- Check if all elements of binary array can be made 1
- Find the possible permutation of the bits of N
- Convert N to M with given operations using dynamic programming
- Count of N-digit numbers in base K with no two consecutive zeroes
- Check whether N is a Factorion or not
- Count of elements which are not at the correct position
- Sentinel Linear Search
- Count the pairs in an array such that the difference between them and their indices is equal
- Program to calculate area of a rhombus whose one side and diagonal are given
- Program to implement FLAMES game
- Check if two given Circles are Orthogonal or not
- Find the ratio of number of elements in two Arrays from their individual and combined average
- Check whether two strings can be made equal by copying their characters with the adjacent ones
- Minimum possible number with the given operation
- Check if it is possible to move from (0, 0) to (X, Y) in exactly K steps
- Find next greater element with no consecutive 1 in it's binary representation
- Significant Inversions in an Array
- Minimum absolute difference between N and any power of 2
- Number of ways in which N can be represented as the sum of two positive integers
- Permutations of n things taken all at a time with m things never come together
- Minimize the cost of partitioning an array into K groups
- Range maximum query using Sparse Table
- Number of ways to erase exactly one element in the Binary Array to make XOR zero
- Maximum distance between two 1's in Binary representation of N
- Minimum steps required to reduce all the elements of the array to zero
- Find a pair (n,r) in an integer array such that value of nPr is maximum
- Minimum length String with Sum of the alphabetical values of the characters equal to N
- Minimum number of additons to make the string balanced
- Maximum number of line intersections formed through intersection of N planes
- Program to find Nth odd Fibonacci Number
- Sum of all the numbers present at given level in Pascal's triangle
- Longest Increasing Subsequence using Longest Common Subsequence Algorithm
- Sorting objects using In-Place sorting algorithm
- Product of values of all possible non-empty subsets of given Array
- Sum of the count of number of adjacent squares in an M X N grid
- Count of N-bit binary numbers without leading zeros
- Find the next fibonacci number
- Find missing elements from an Array
- Count of elements on the left which are divisible by current element
- Find the minimum value of X for an expression
- Minimum increment or decrement operations required to make the array sorted
- Number of words that can be made using exactly P consonants and Q vowels from the given string
- Angle subtended by an arc at the centre of a circle
- Represent the given number as the sum of two composite numbers
- Maximum number of distinct positive integers that can be used to represent N
- Find the previous fibonacci number
- Find the quadratic equation from the given roots
- Smallest N digit number which is a perfect fourth power
- Kth number from the set of multiples of numbers A, B and C
- Count of 0s in an N-level hexagon
- Maximum of all the integers in the given level of Pascal triangle
- Program to print the Diagonals of a Matrix
- Count number of ways to arrange first N numbers
- Finding the converging element of the diagonals in a square matrix
- Generate an array B[] from the given array A[] which satisfies the given conditions
- Find X and Y intercepts of a line passing through the given points
- Number of edges in a perfect binary tree with N levels
- Maximum possible Bitwise OR of the two numbers from the range [L, R]
- Check if given path between two nodes of a graph represents a shortest paths
- Check if the bracket sequence can be balanced with at most one change in the position of a bracket | Set 2
- Program to clear K-th bit of a number N
- Sum of subsets of all the subsets of an array | O(3^N)
- Longest sub-sequence with a given OR value : O(N) Approach
- Find a number X such that (X XOR A) is minimum and the count of set bits in X and B are equal
- Form N by adding 1 or 2 in minimum number of operations X where X is divisible by M
- Find the Mid-Alphabet for each index of the given Pair of Strings
- Number of ways to divide string in sub-strings such to make them in lexicographically increasing sequence
- Smallest subarray with GCD as 1 | Segment Tree
- Number of subsets with sum divisible by M | Set 2
- Maximum sum subarray of even length
- Check if two strings can be made equal by swapping one character among each other
- N consecutive ropes problem
- Count of columns with odd number of 1s
- Maximum Bitwise OR pair from a range
- Check whether all the substrings have number of vowels atleast as that of consonants
- Sum of the updated array after performing the given operation
- Reduce every element of the array to it's half retaining the sum zero
- Find permutation array from the cumulative sum array
- Find the centroid of a non-self-intersecting closed Polygon
- Longest subsequence having difference atmost K
- Count of primes below N which can be expressed as the sum of two primes
- Find all the possible remainders when N is divided by all positive integers from 1 to N+1
- Maximum sum combination from the given array
- Find the final number obtained after performing the given operation
- Check if a symmetric plus is possible from the elements of the given array
- Check if given string contains all the digits
- Winner in the Rock-Paper-Scissor game using Bit manipulation