In this post, we will see how to find all lexicographic permutations of a string where repetition of characters is allowed.
Find all N-digit binary numbers with equal sum of left and right half. N varies from [1-9] and binary number should not start with 0.
In this post, we will see how to traverse the given directory and list out all files present in it and all its sub-directories.
Given a set S, generate all distinct subsets of it i.e., find distinct power set of set S. A power set of any set S is the set of all subsets of S, including the empty set and S itself.
Given a string, find minimum cuts needed to partition it such that each partition is a palindrome.
Given a sorted array of integers, find floor and ceil of a given number in it. The floor and ceiling map the given number to the largest previous or the smallest following integer, respectively.
Given a binary search tree, find a pair with given sum present in it.
Given a binary tree, write an efficient algorithm to compute maximum width of it.
Given a square matrix, print maximum length snake sequence in it. A Snake sequence is defined as a sequence of numbers where each new number, which can only be located to the right or down of the current number, is either plus or minus one.
In k-partition problem, we need to partition an array of positive integers into k disjoint subsets that all have equal sum and they completely covers the set.
3-partition problem: Given a set S of positive integers, determine if it can be partitioned into three disjoint subsets that all have same sum and they cover S.
Given a positive integer N, find all N-digit binary numbers having more 1’s than 0’s for any prefix of the number.