princi singh hasn't contributed any 'Articles' yet!

- Remove duplicates from a given string
- Detect loop in a linked list
- Find the Number Occurring Odd Number of Times
- Queue using Stacks
- Maximum width of a binary tree
- Print a given matrix in spiral form
- N Queen Problem | Backtracking-3
- Pattern Searching | Set 6 (Efficient Construction of Finite Automata)
- Find four elements that sum to a given value | Set 2 ( O(n^2Logn) Solution)
- Given a sequence of words, print all anagrams together | Set 1
- Implement Stack using Queues
- Largest Independent Set Problem | DP-26
- A Pancake Sorting Problem
- How to check if two given line segments intersect?
- Convex Hull | Set 1 (Jarvis's Algorithm or Wrapping)
- Reverse alternate levels of a perfect binary tree
- Function to find Number of customers who could not get a computer
- How to print maximum number of A's using given four keys
- Group multiple occurrence of array elements ordered by first occurrence
- Find the nearest smaller numbers on left side in an array
- Find sum of all elements in a matrix except the elements in row and/or column of given cell?
- Count distinct elements in every window of size k
- How to check if a given array represents a Binary Heap?
- Range Minimum Query (Square Root Decomposition and Sparse Table)
- Count number of paths with at-most k turns
- Form minimum number from given sequence
- Print maximum sum square sub-matrix of given size
- Repeated subsequence of length 2 or more
- Cuckoo Hashing - Worst case O(1) Lookup!
- Print Binary Tree in 2-Dimensions
- Print all words matching a pattern in CamelCase Notation Dictonary
- Rearrange array in alternating positive & negative items with O(1) extra space | Set 2
- Find frequency of each element in a limited range array in less than O(n) time
- Palindrome Substring Queries
- Maximize arr[j] - arr[i] + arr[l] - arr[k], such that i < j < k < l
- A Space Optimized DP solution for 0-1 Knapsack Problem
- Frequency Measuring Techniques for Competitive Programming
- Flip Binary Tree
- Remove Invalid Parentheses
- Maximum and Minimum Product Subsets
- Perfect reversible string
- Minimum Cost to cut a board into squares
- Maximum mirrors which can transfer light from bottom to right
- XOR Cipher
- Find maximum difference between nearest left and right smaller elements
- Partition of a set into K subsets with equal sum
- Minimum cost to sort strings using reversal operations of different costs
- Program to toggle all characters in a string
- Sublist Search (Search a linked list in another list)
- Find sum of divisors of all the divisors of a natural number
- Divide array into two sub-arrays such that their averages are equal
- Pairs of Amicable Numbers
- Type of array and its maximum element
- Program for FCFS CPU Scheduling | Set 2 (Processes with different arrival times)
- Find the Deepest Node in a Binary Tree
- Find the largest multiple of 3 from array of digits | Set 2 (In O(n) time and O(1) space)
- Recaman's sequence
- Count of arrays in which all adjacent elements are such that one of them divide the another
- Sorting Strings using Bubble Sort
- Print All Distinct Elements of a given integer array
- Program to find remainder without using modulo or % operator
- Check if given string can be split into four distinct strings
- Doolittle Algorithm : LU Decomposition
- Move spaces to front of string in single traversal
- Convert given time into words
- Alternate vowel and consonant string
- Count the number of ways to divide an array into three contiguous parts having equal sum
- Find shortest unique prefix for every word in a given list | Set 2 (Using Sorting)
- Insertion Sort for Doubly Linked List
- Shortest path between two nodes in array like representation of binary tree
- Recursive Selection Sort
- Program to find line passing through 2 Points
- Find the sum of last n nodes of the given Linked List
- Count pairs from two linked lists whose sum is equal to a given value
- Find the Sub-array with sum closest to 0
- Find the character in first string that is present at minimum index in second string
- Recursive selection sort for singly linked list | Swapping node links
- Print odd positioned nodes of odd levels in level order of the given binary tree
- 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
- Print nodes at k distance from root | Iterative
- Find All Duplicate Subtrees
- Program to Count numbers on fingers
- Check whether right angled triangle is valid or not for large sides
- Repeatedly search an element by doubling it after every successful search
- Shortest possible combination of two strings
- Count subarrays with equal number of occurrences of two given elements
- Interleave the first half of the queue with second half
- Sum and Product of Prime Frequencies of Characters in a String
- A sorting algorithm that slightly improves on selection sort
- Array range queries over range queries
- Difference between highest and least frequencies in an array
- Longest Repeated Subsequence
- Check if a two character string can be made using given words
- Longest increasing sublist in a linked list
- Secretary Problem (A Optimal Stopping Problem)
- Direction of a Point from a Line Segment
- Longest subarray having count of 1s one more than count of 0s
- Longest subsequence such that difference between adjacents is one | Set 2
- Program to sort string in descending order
- Longest subsequence of the form 0*1*0* in a binary string
- Root to leaf path with maximum distinct nodes
- Largest increasing subsequence of consecutive integers
- Binary tree to string with brackets
- Check whether a number can be represented by sum of two squares
- Pair with given sum and maximum shortest distance from end
- Last seen array element (last appearance is earliest)
- Frequency of a substring in a string
- Count of operations to make a binary string"ab" free
- Change string to a new character set
- Identify and mark unmatched parenthesis in an expression
- Count subarrays where second highest lie before highest
- Minimum cost to make Longest Common Subsequence of length k
- Print n smallest elements from given array in their original order
- Construct a graph from given degrees of all vertices
- Minimum number of points to be removed to get remaining points on one side of axis
- Print reverse of a Linked List without extra space and modifications
- Change the array into a permutation of numbers from 1 to n
- Reverse first K elements of given linked list
- Program for triangular patterns of alphabets
- Count of subsequences having maximum distinct elements
- Sorted merge of two sorted doubly circular linked lists
- Growable array based stack
- Deepest right leaf node in a binary tree | Iterative approach
- Level of Each node in a Tree from source node (using BFS)
- Insertion Sort by Swapping Elements
- Maximum rational number (or fraction) from an array
- Count maximum-length palindromes in a String
- Lexicographical concatenation of all substrings of a string
- Linked List Pair Sum
- Majority element in a linked list
- Sum of heights of all individual nodes in a binary tree
- Smallest value in each level of Binary Tree
- Find common elements in three linked lists
- Function to copy string (Iterative and Recursive)
- Find one extra character in a string
- Rat in a Maze with multiple steps or jump allowed
- Lexicographically next greater string using same character set
- Sum of nodes at maximum depth of a Binary Tree
- Disjoint Set Union on trees | Set 1
- Bitwise recursive addition of two integers
- Delete all Prime Nodes from a Singly Linked List
- Sum of cousins of a given node in a Binary Tree
- Program to reverse a string (Iterative and Recursive)
- Count number of pairs in array having sum divisible by K | SET 2
- Maximum length of a sub-array with ugly numbers
- Count pairs with set bits sum equal to K
- Find the only element that appears b times
- Smallest number in BST which is greater than or equal to N
- Check if array sum can be made K by three operations on it
- Find the lexicographical next balanced bracket sequence
- Print all pairs with given sum
- Repeated Character Whose First Appearance is Leftmost
- Print all triplets with given sum
- Inorder predecessor and successor for a given key in BST | Iterative Approach
- Check if two trees are mirror of each other using level order traversal
- Count occurrences of a substring recursively
- Reorder the given string to form a K-concatenated string
- Level order traversal with direction change after every two levels | Recursive Approach
- Square of large number represented as String
- Level order traversal in spiral form | Using one stack and one queue
- Print the nearest prime number formed by adding prime numbers to N
- Check if any permutation of a large number is divisible by 8
- Sum of all odd frequency elements in a Matrix
- Sorting without comparison of elements
- Shortest distance between two nodes in an infinite binary tree
- Weird Number
- Majority Element | Set-2 (Hashing)
- Program to print Sine-Wave Pattern
- Delete array element in given index range [L - R]
- Counting frequencies of array elements
- Find total number of distinct years from a string
- Find out the correct position of the ball after shuffling
- Find the largest after deleting the given elements
- Concatenate strings in any order to get Maximum Number of "AB"
- Maximum occurred integer in n ranges | Set-2
- Maximize the product of four factors of a Number
- Longest subarray having difference in the count of 1's and 0's equal to k
- Check if given string can be formed by two other strings or their permutations
- Find any pair with given GCD and LCM
- Program to Add Two Complex Numbers
- Minimum and Maximum Prime Numbers of a Singly Linked List
- Sort Linked List containing values from 1 to N
- Quotient - Remainder Sort
- Maximum element in min heap
- Find maximum in a stack in O(1) time and O(1) extra space
- Check whether the given number is Euclid Number or not
- Check whether it is possible to join two points given on circle such that distance between them is k
- Find the sum of all highest occurring elements in an Array
- Sum of all odd frequency elements in an array
- Iterative program to find distance of a node from root
- Product of non-repeating (distinct) elements in an Array
- Find the winner of the game with N piles of boxes
- Minimum number of nodes in an AVL Tree with given height
- Check if a number is a Trojan Number
- Root to leaf path product equal to a given number
- Find the smallest after deleting given elements
- Program to find count of numbers having odd number of divisors in given range
- Check whether a number has consecutive 0's in the given base or not
- Sorting array elements with set bits equal to K
- Count pairs in an array such that both elements has equal set bits
- Find if array has an element whose value is half of array sum
- In-Place Merge Sort
- Count pairs from two arrays whose modulo operation yields K
- Count distinct pairs from two arrays having same sum of digits
- Print path between any two nodes in a Binary Tree
- Find all numbers that divide maximum array elements
- Radii of the three tangent circles of equal radius which are inscribed within a circle of given radius
- Find the node whose absolute difference with X gives maximum value
- Find the largest interval that contains exactly one of the given N integers.
- Subtraction in the Array
- Check if the string satisfies the given condition
- Number of pairs whose sum is a power of 2
- Recursive program to insert a star between pair of identical characters
- Shortest root to leaf path sum equal to a given number
- Count rows in a matrix that consist of same element
- Number of ways to divide a Binary tree into two halves
- A variation of Rat in a Maze : multiple steps or jumps allowed
- Print numbers such that no two consecutive numbers are co-prime and every three consecutive numbers are co-prime
- Sum of all the Boundary Nodes of a Binary Tree
- Count triplet pairs (A, B, C) of points in 2-D space that satisfy the given condition
- Iterative Letter Combinations of a Phone Number
- Queries for number of distinct integers in Suffix
- Number of trailing zeroes in base B representation of N!
- Sum of minimum element of all sub-sequences of a sorted array
- Print the last k nodes of the linked list in reverse order | Iterative Approaches
- Sum of nodes in top view of binary tree
- Longest path in a directed Acyclic graph | Dynamic Programming
- Search an element in given N ranges
- Correct the Random Pointer in Doubly Linked List
- Find the hypotenuse of a right angled triangle with given two sides
- Generate all binary strings of length n with sub-string "01" appearing exactly twice
- Delete odd and even numbers at alternate step such that sum of remaining elements is minimized
- Minimum sub-array such that number of 1's in concatenation of binary representation of its elements is at least K
- Maximum length cycle that can be formed by joining two nodes of a binary tree
- Building Heap from Array
- Minimum value of X to make all array elements equal by either decreasing or increasing by X
- Find the largest Perfect Subtree in a given Binary Tree
- Minimum increments to convert to an array of consecutive integers
- Convert Directed Graph into a Tree
- Bellman Ford Algorithm (Simple Implementation)
- K-th ancestor of a node in Binary Tree | Set 3
- Create linked list from a given array
- Bitwise AND of sub-array closest to K
- Generate two BSTs from the given array such that maximum height among them is minimum
- Check if the given array contains all the divisors of some integer
- Check if the given matrix is increasing row and column wise
- Angle between a chord and a tangent when angle in the alternate segment is given
- Find a triplet in an array whose sum is closest to a given number
- Number of ways to divide an array into K equal sum sub-arrays
- Length of the chord the circle if length of the another chord which is equally inclined through the diameter is given
- Count duplicates in a given linked list
- Find the number of Chicks in a Zoo at Nth day
- Paths from entry to exit in matrix and maximum path sum
- Find the smallest positive number missing from an unsorted array : Hashing Implementation
- Count of three non-overlapping sub-strings which on concatenation forms a palindrome
- Maximise array sum after taking non-overlapping sub-arrays of length K
- Length of the largest substring which have character with frequency greater than or equal to half of the substring
- Check whether two strings contain same characters in same order
- Count pairs of elements such that number of set bits in their AND is B[i]
- Split the given array into K sub-arrays such that maximum sum of all sub arrays is minimum
- Number of ways to choose elements from the array such that their average is K
- Find the element in the matrix generated by given rules
- Gap Buffer Data Structure
- Largest sub-string where all the characters appear at least K times
- Count of characters in str1 such that after deleting anyone of them str1 becomes str2
- Count common elements in two arrays containing multiples of N and M
- Print Bottom-Right View of a Binary Tree
- Find number of factors of N when location of its two factors whose product is N is given
- Rearrange characters in a string such that no two adjacent are same using hashing
- 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
- Number of triplets such that each value is less than N and each pair sum is a multiple of K
- Count numbers in given range such that sum of even digits is greater than sum of odd digits
- Sum of Semi-Prime Numbers less than or equal to N
- Maximum XOR with given value in the path from root to given node in the tree
- Nodes from given two BSTs with sum equal to X
- Flatten binary tree in order of post-order traversal
- Count substrings that contain all vowels | SET 2
- Number of ways of distributing N identical objects in R distinct groups
- Find the position of the given row in a 2-D array
- Distinct adjacent elements in a binary array
- 21 Matchsticks Problem
- Count of strings in the first array which are smaller than every string in the second array
- Programs to print Triangle and Diamond patterns using recursion
- Number of N length sequences whose product is M
- Number of Quadruples with GCD equal to K
- Count total set bits in all numbers from 1 to n | Set 2
- Maximum length palindromic substring such that it starts and ends with given char
- Generate all possible strings such that char at index i is either str1[i] or str2[i]
- Sort the Queue using Recursion
- Number of ways to arrange 2*N persons on the two sides of a table with X and Y persons on opposite sides
- Perimeter of an Ellipse
- XOR in a range of a binary array
- Swap all occurrences of two characters to get lexicographically smallest string
- Number of balanced parenthesis substrings
- Find maximum xor of k elements in an array
- Find the sum of the first half and second half elements of an array
- Maximum sum of the array after dividing it into three segments
- Time taken per hour for stoppage of Car
- Convert a String to an Integer using Recursion
- Find the difference of count of equal elements on the right and the left for each element
- 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
- Square root of a number without using sqrt() function
- Alcuin's Sequence
- Wedderburnâ€“Etherington number
- Subtraction of the alternate nodes of Linked List
- Find the final sequence of the array after performing given operations
- Find the kth smallest number with sum of digits as m
- 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
- Reduce number to a single digit by subtracting adjacent digits repeatedly
- Sum of prime numbers without odd prime digits
- Find the area of quadrilateral when diagonal and the perpendiculars to it from opposite vertices are given
- Number of shortest paths to reach every cell from bottom-left cell in the grid
- How to learn Pattern printing easily?
- Find the maximum cost path from the bottom-left corner to the top-right corner
- Find the ln(X) and log
_{10}X with the help of expansion - Count number of ways to reach destination in a Maze using BFS
- Find the average of k digits from the beginning and l digits from the end of the given number
- Minimum operations required to convert a binary string to all 0s or all 1s
- Find the remaining balance after the transaction
- Count all the permutation of an array
- Count number of bits to be flipped to convert A to B | Set-2
- Minimum number of Fibonacci jumps to reach end
- Reversing a Queue using another Queue
- Nth XOR Fibonacci number
- Count of triplets that satisfy the given equation
- Position of Elements which are equal to sum of all Preceding elements
- Check if it is possible to perform the given Grid Division
- Minimum distance to visit all the nodes of an undirected weighted tree
- Maximum XOR of Two Numbers in an Array
- Area of the largest square that can be formed from the given length sticks using Hashing
- Maximum subsequence sum such that all elements are K distance apart
- Largest substring of str2 which is a prefix of str1
- Find a Square Matrix such that sum of elements in every row and column is K
- Print odd positioned nodes of even levels in level order of the given binary tree
- Calculate height of Binary Tree using Inorder and Level Order Traversal
- Print characters having even frequencies in order of occurrence
- Product of elements in an array having prime frequency
- Find the number on the card that remains in the end after performing the given operations
- Count total set bits in all numbers from 1 to N | Set 3
- Find the minimum capacity of the train required to hold the passengers
- Count of numbers in the range [L, R] which satisfy the given conditions
- Count of triples (A, B, C) where A*C is greater than B*B
- Count of subsets not containing adjacent elements
- Check if the rows of a binary matrix can be made unique by removing a single column
- Sum of the digits of square of the given number which has only 1's as its digits
- Minimum cost to make all array elements equal
- Array containing power of 2 whose XOR and Sum of elements equals X
- Number of occurrences of a given angle formed using 3 vertices of a n-sided regular polygon
- GCD of elements which occur prime number of times
- Find the permutation of first N natural numbers such that sum of i % P
_{i}is maximum possible - Bitwise XOR of elements having odd frequency
- Count equal element pairs in the given array
- Count number of Special Set
- Printing the Triangle Pattern using last term N