Given an array consisting of only 1s and 0s, sort this binary array such that all 0s are on the left and all 1s are on the right.
The Tower of Hanoi is a mathematical puzzle (game) consisting of three rods and a number of disks.
The objective of the puzzle is to move all the disks from the first rod (A) to the next rod (B) using the auxiliary rod (C).
The number of possible Binary Search Trees with n keys is Catalan Number (Cn). You could learn about Catalan Number & Binomial Coefficient.
Catalan numbers (Cn) are a sequence of natural numbers. Nth Catalan number has applications in many counting problems.
The recomputations in calculating binomial coefficient (nCr) can be avoided by exploiting optimal substructure and overlapping subproblems
Starting with a 1-indexed array of zeros and a list of operations, for each operation add a value to each the array element between two given indices, inclusive. Once all operations have been performed, return the maximum value in the array.
Given a string of lowercase letters in the range ascii[a-z], determine the index of a character that can be removed to make the string a palindrome
Print all the nodes that you encounter while printing DFS tree. Then, print the distance ‘D’ between the source ‘P’ and the destination ‘.’
Jim is doing his discrete maths homework which requires him to repeatedly calculate nCr(n choose r) for different values of n
Given two strings p and q of equal length, what’s the longest string that can be constructed such that it is a child of both?